GitHub Setup
Create a GitHub OAuth App to access repositories, issues, pull requests, and more. Supports read-only or full write access.
Setup Steps
Section titled “Setup Steps”-
Go to Developer Settings
Navigate to your GitHub Developer Settings.
-
Create OAuth App
Click “OAuth Apps” in the left sidebar, then “New OAuth App”. Fill in:
- Application name: Fp Switchboard
- Homepage URL: https://switchboard.fpdigital.ai
- Application description: (optional)
- Authorization callback URL: (see below)
-
Set Callback URL
Add the OAuth callback URL:
https://api.switchboard.fpdigital.ai/oauth/github/callback -
Save and Copy Credentials
Click “Register application”. You’ll see your Client ID. Click “Generate a new client secret” to create the secret.
-
Set Wrangler Secrets
Add the credentials as Cloudflare Workers secrets:
Terminal window npx wrangler secret put GITHUB_CLIENT_IDnpx wrangler secret put GITHUB_CLIENT_SECRET
Environment Variables
Section titled “Environment Variables”npx wrangler secret put GITHUB_CLIENT_IDnpx wrangler secret put GITHUB_CLIENT_SECRET| Variable | Description |
|---|---|
GITHUB_CLIENT_ID | OAuth App Client ID from GitHub Developer Settings |
GITHUB_CLIENT_SECRET | OAuth App Client Secret (generated once) |
Redirect URI
Section titled “Redirect URI”https://api.switchboard.fpdigital.ai/oauth/github/callbackScopes
Section titled “Scopes”Users choose Read-only or Full Access when connecting:
| Mode | Scopes |
|---|---|
| Read-only | public_repo, read:user, read:org |
| Full Access | repo, read:user, read:org, gist, workflow, notifications |
Important Notes
Section titled “Important Notes”- For organization repos, the org admin may need to approve the OAuth app
- This uses OAuth App (not GitHub App) - simpler setup, no installation required
- Rate limit: 5,000 requests per hour per authenticated user
Common Issues
Section titled “Common Issues”- Organization repo access: If you can’t see org repos, the org admin needs to approve the OAuth app. Go to the org’s Settings > Third-party access.
- Private repo access: Read-only mode (
public_reposcope) only accesses public repos. Switch to Full Access for private repos. - Rate limiting: GitHub allows 5,000 requests/hour per user. Heavy operations like listing all repos may hit limits.
- Tokens don’t expire: GitHub OAuth tokens are permanent. They only stop working if the user revokes access or the OAuth app is deleted.
Testing
Section titled “Testing”- Go to your Switchboard Dashboard and navigate to GitHub
- Click Connect and authorize (choose Read-only or Full Access)
- Click Test Connection to verify
- Try: “List my GitHub repositories” or “Show open issues in [repo]”