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

Discord Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_DISCORD_ID AUTH_DISCORD_SECRET

Configuration

/auth.ts
import NextAuth from "next-auth" import Discord from "next-auth/providers/discord"   export const { handlers, auth, signIn, signOut } = NextAuth({  providers: [Discord], })
Auth.js © Better Auth Inc. - 2025