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

Logto Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_LOGTO_ID
AUTH_LOGTO_SECRET
AUTH_LOGTO_ISSUER

Configuration

Follow these steps:

Go to the Logto Console, Applications -> Your application

Add the required environment variables to your .env.local file.

AUTH_LOGTO_ID="<APP ID>" # Endpoints & Credentials -> App ID
AUTH_LOGTO_SECRET="<APP SECRET>" # Endpoints & Credentials -> App Secrets
AUTH_LOGTO_ISSUER="<LOGTO ENDPOINT>" # Endpoints & Credentials -> Logto endpoint
/auth.ts
import NextAuth from "next-auth"
import Logto from "next-auth/providers/logto"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Logto],
})
Auth.js © Balázs Orbán and Team - 2025