Get credentials
Create an application
Go to the Discord Developer Portal and click New Application. Give it a name.Copy credentials
From OAuth2 > General, copy the Client ID and Client Secret.Configuration
lib/kavach.ts
Scopes
Default scopes:identify email
| Scope | What it unlocks |
|---|---|
identify | Read username, discriminator, avatar |
email | Read the user’s email address |
guilds | Read the servers the user belongs to |
guilds.members.read | Read guild membership details |
User data returned
| Field | Source | Notes |
|---|---|---|
id | id field | Stable Discord snowflake ID |
email | email field | Verified email |
name | username field | Current username (not discriminator) |
image | avatar hash | Constructed CDN URL |
Discord email addresses are verified before the account can use OAuth. You will always receive a verified email when the
email scope is requested.