Auth Adaptersauth
Auth
Resolve end-user identity through Clerk, WorkOS, or better-auth with the adapter that matches the host app.
ClerkWorkOSbetter-auth
Supported adapters
Auth adapter docs should stay aligned with the adapters that actually ship.
Clerk
Use when the host app resolves sessions through Clerk.
WorkOS
Use when the host app resolves sessions through WorkOS.
better-auth
Use when the host app already has a `better-auth` instance.
Clerk
Clerk remains a first-class adapter with optional peer dependencies.
auth-clerk.ts
import { createClerkAuthAdapter } from "clivly/auth/clerk";
const authAdapter = createClerkAuthAdapter({
secretKey: process.env.CLERK_SECRET_KEY!,
publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
});
const user = await authAdapter.getUser(request);WorkOS
WorkOS remains a first-class adapter with provider credentials and cookie password handling.
auth-workos.ts
import { createWorkOSAuthAdapter } from "clivly/auth/workos";
const authAdapter = createWorkOSAuthAdapter({
apiKey: process.env.WORKOS_API_KEY!,
clientId: process.env.WORKOS_CLIENT_ID!,
cookiePassword: process.env.WORKOS_COOKIE_PASSWORD!,
});
const user = await authAdapter.getUser(request);better-auth
better-auth is now part of the public integration surface and should not be missing from the docs route.
auth-better-auth.ts
import { createBetterAuthAdapter } from "clivly/auth/better-auth";
import { auth } from "./auth";
const authAdapter = createBetterAuthAdapter({ auth });
const user = await authAdapter.getUser(request);Previous
Chat Widget
Next
Packages