@synqid/nextjs.
Three files. Full OIDC.
Drop-in OIDC for Next.js 16+. Catch-all route handler, server- side Data Access Layer with predicate guards, edge-safe middleware proxy, and the React provider for client components. App Router and Pages Router both supported.
Install
pnpm add @synqid/nextjs @synqid/jsThree files
The full OIDC integration. Route handler, layout, server DAL. Optional middleware for path-based protection.
// app/api/auth/[...synq]/route.ts
import { synqHandlers } from '@synqid/nextjs/server'
export const { GET, POST } = synqHandlers()Server-first, RSC-aware
auth() / verifySession() / getUser()
Server-side helpers that read the session cookie, refresh on expiry, and return typed data. Safe to call in any RSC or route handler.
requireGuest() / requireAccess()
Predicate-based guards. Throw on missing session (so your error boundary renders the sign-in path) or fail-closed when the predicate rejects.
synqProxy()
Edge-safe middleware. Path-based access control without a server roundtrip, with optional refresh-on-edge if your session is close to expiry.
SynqProvider + hooks
The client side. Same hooks as @synqid/react (useUser, useSynq, useAccessToken) bound to the Next.js cookie-based session.
Common questions
Three files. Full OIDC. No glue..
Drop the route handler, drop the provider, call auth() in your RSC. You are done before tea cools.
