authlab-next
v0.2.2
Published
Next.js helpers for Authlab (SSR-safe)
Downloads
325
Readme
authstack-next
Next.js helpers for Authlab (SSR-safe). Works with authlab-js.
Install
npm install authstack-next authlab-jsUsage
Use getAuthUser in API routes or server components to get the current user from cookies or the Authorization header.
import { getAuthUser } from "authstack-next";
const user = await getAuthUser({
baseUrl: process.env.AUTHLAB_BASE_URL!,
apiKey: process.env.AUTHLAB_API_KEY!,
getToken: () => request.cookies.get("authlab_token")?.value ?? null,
});License
MIT
