Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

WorkOS Provider

Resources

Setup

Callback URL

https://example.com/api/auth/callback/workos

Environment Variables

AUTH_WORKOS_ID
AUTH_WORKOS_SECRET

WorkOS also requires you to pass in your connection ID to the provider.

Configuration

/auth.ts
import NextAuth from "next-auth"
import WorkOS from "next-auth/providers/workos"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [WorkOS({ connection: "conn_abc123" })],
})
Auth.js © Balázs Orbán and Team - 2024