Discord OAuth with PKCE and avatar mapping.
Discord uses scopes like identify and email. PKCE (S256) is enabled by default. The SDK maps the avatar URL using the id and avatar fields when available.
# .env.local
AUTH_SECRET=your-secret-key-min-32-chars-long
DISCORD_CLIENT_ID=your-discord-client-id
DISCORD_CLIENT_SECRET=your-discord-client-secret
DISCORD_REDIRECT_URI=http://localhost:3000/api/auth/callback/discordMinimal configuration
import { discord } from '@warpy-auth-sdk/core';
const provider = discord({
clientId: process.env.DISCORD_CLIENT_ID!,
clientSecret: process.env.DISCORD_CLIENT_SECRET!,
redirectUri: process.env.DISCORD_REDIRECT_URI!,
scope: ['identify', 'email'],
});