Skip to content
The Auth.js project is now part of Better Auth.

Scalekit Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_SCALEKIT_ID
AUTH_SCALEKIT_SECRET
AUTH_SCALEKIT_ISSUER

AUTH_SCALEKIT_ISSUER is your Scalekit environment URL (e.g. https://yourenv.scalekit.dev).

Configuration

/auth.ts
import NextAuth from "next-auth"
import Scalekit from "next-auth/providers/scalekit"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Scalekit],
})

SSO Routing

Scalekit supports multiple ways to route users to their SSO connection. You can pass optional routing parameters to target a specific connection:

/auth.ts
import NextAuth from "next-auth"
import Scalekit from "next-auth/providers/scalekit"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [
    Scalekit({
      // pick one of the following routing strategies:
      connectionId: "conn_...", // exact connection (highest precedence)
      organizationId: "org_...", // org's active SSO connection
      domain: "acme.com", // resolve org from email domain
    }),
  ],
})
💡

Scalekit is an OIDC-compliant platform — Auth.js automatically discovers all endpoints from your AUTH_SCALEKIT_ISSUER URL via /.well-known/openid-configuration. No manual endpoint configuration is required.

Auth.js © Better Auth Inc. - 2026