Get credentials
Register an OAuth App
Go to github.com/settings/applications/new (personal account) or Organization Settings > Developer Settings > OAuth Apps for an org app.- Application name: your app name
- Homepage URL:
https://example.com - Authorization callback URL:
https://auth.example.com/auth/oauth/github/callback
Copy credentials
After creating the app, copy the Client ID. Click Generate a new client secret and copy the secret immediately. GitHub only shows it once.GitHub also supports GitHub Apps, which have more granular permissions and work across organizations. OAuth Apps are simpler for sign-in use cases.
Configuration
- Basic
- With extra scopes
lib/kavach.ts
Scopes
Default scope:user:email
| Scope | What it unlocks |
|---|---|
user:email | Read the user’s email addresses |
read:user | Read the user’s profile data |
read:org | Read organization membership |
repo | Access private repositories |
User data returned
| Field | Source | Notes |
|---|---|---|
id | id field | Stable numeric GitHub user ID |
email | Primary verified email | Fetched separately if not public |
name | name field | Display name, may be null |
image | avatar_url | GitHub avatar URL |