GitHub App Setup

Generate the exact URLs and configuration you need for GitHub OAuth and GitHub App. Paste these values into GitHub Developer Settings.

1. Base URL

Your app URL (e.g. https://agentmd.io for production, http://localhost:3001 for local dev)

2. GitHub OAuth App

Required for Sign in with GitHub. Create at GitHub → OAuth Apps

Authorization callback URL

Paste this into the OAuth App settings

https://agentmd.io/api/auth/callback/github

3. GitHub App

Optional — for repo connection and webhooks. Create at GitHub → GitHub Apps

Webhook URL

https://agentmd.io/api/github/webhooks

Callback URL

https://agentmd.io/api/github/callback

Setup URL

https://agentmd.io/dashboard

Webhook secret

Generate a random string and paste into GitHub App webhook settings

[run: openssl rand -hex 32]

4. Environment variables

Add these to your deployment (Vercel, Railway, etc.) or .env.local

# GitHub OAuth App (required for login)
GITHUB_ID=your_client_id
GITHUB_SECRET=your_client_secret

# GitHub App (optional — repo connection & webhooks)
GITHUB_APP_ID=your_app_id
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
GITHUB_APP_SLUG=your-app-slug
GITHUB_WEBHOOK_SECRET=your_webhook_secret

Manual setup

Prefer step-by-step instructions? See deploy/provision/GITHUB.md in the repo.