Integrating with Next.js
Using AuthAction SDKs
Section titled “Using AuthAction SDKs”Two SDK options depending on your architecture:
Client-side auth (SPA-style, App Router client components):
npm install @authaction/web-sdk// app/layout.tsx — wrap with the Next.js providerimport { AuthActionNextProvider } from "@authaction/web-sdk/nextjs";Server-side sessions (server components, route handlers):
npm install @authaction/server-sdkimport { createNextHandlers } from "@authaction/server-sdk/nextjs";export const { GET } = createNextHandlers({ domain, clientId, sessionSecret, redirectUri });// Handles /api/auth/login, /api/auth/callback, /api/auth/logout automaticallySDK references: web-sdk · server-sdk