GuidesAuth Providers
Discord Auth
Add Discord OAuth sign-in to your app.
Docs are in beta — content is improving rapidly. Found something missing? Open an issue on GitHub or reach out on Twitter (X).
1. Create a Discord Application
- Go to the Discord Developer Portal and click New Application
- Give it a name and click Create
- In the left sidebar, click OAuth2
- Under Redirects, add:
http://localhost:3000/api/auth/callback/discord(dev)https://yourdomain.com/api/auth/callback/discord(prod)
- Copy the Client ID and Client Secret from the OAuth2 page
2. Set Environment Variables
# .env.local
DISCORD_CLIENT_ID=your-client-id
DISCORD_CLIENT_SECRET=your-client-secret3. Enable in Config
In src/appConfig.ts set:
discord: { enabled: true },4. Test
- Run
pnpm dev - Navigate to
/auth/sign-in - A Sign in with Discord button will appear
Production Checklist
- Add your production callback URL to the Redirects list in the Discord Developer Portal
Troubleshooting
- No email returned — Discord phone-only accounts don't return an email even with the
emailscope. This is a Discord limitation. - No Discord button — check
DISCORD_CLIENT_IDandDISCORD_CLIENT_SECRETare set anddiscord.enabledistrueinappConfig.ts