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