All Guides
Setup Guide · Integration

GitHub Integration

Connect rkito to GitHub to enable repo ingestion, automatic Design Audit on pull requests, and architecture manifest write-back.

What rkito uses GitHub for

FeatureMechanism
Repo ingestionApp installation — reads repo file tree
Design AuditPR webhook → triggers AI review on open/sync
Architecture manifestApp installation — commits .rkito/architecture.yaml
Org webhooksWebhook on installation events

1. Create the GitHub App

1
Go to GitHub → Settings → Developer settings → GitHub Apps → New GitHub App
2
Fill in the required fields:
FieldValue
GitHub App namerkito (or rkito-dev for dev)
Homepage URLhttps://app.yourdomain.com
Callback URLhttps://api.yourdomain.com/api/v1/integrations/githubs/installations/callback
Setup URL (after installation)https://api.yourdomain.com/api/v1/integrations/githubs/installations/callback
Redirect on update✅ checked
Webhook → Active✅ checked
Webhook URLhttps://api.yourdomain.com/api/v1/integrations/githubs/orgwebhook
Webhook secretGenerate with: openssl rand -hex 32 (save this)

Repository permissions

PermissionLevel
ContentsRead & write
MetadataRead-only
Pull requestsRead & write
Commit statusesRead & write

Organisation permissions

PermissionLevel
MembersRead-only

Subscribe to events

Check: Pull request, Push, Installation, Installation repositories

2. Generate a private key

1
In your new app, scroll to Private keys → Generate a private key
2
A .pem file downloads automatically. Store its contents in api/.env

3. Set environment variables

Add the following to api/.env:

# GitHub App (installation flow)
GITHUB_APP_ID=123456
GITHUB_APP_SLUG=rkito
GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
GITHUB_WEBHOOK_SECRET=<32-char hex from step 1>

# GitHub OAuth (user login — separate from App)
GITHUB_CLIENT_ID=Iv1.abc123
GITHUB_CLIENT_SECRET=abc123
GITHUB_OAUTH_CALLBACK_URL=https://api.yourdomain.com/api/v1/auth/github/callback

4. URL reference

URLPurpose
/api/v1/integrations/githubs/installations/callbackProcesses OAuth code after GitHub redirects back, stores the installation
/api/v1/integrations/githubs/orgwebhookReceives pull_request, push, installation events from GitHub
/api/v1/auth/github/callbackUser login via GitHub OAuth (separate from App installation)

5. Connect from rkito

1
In rkito, navigate to your org → Integrations → GitHub
2
Click + Connect → enter your GitHub account name → click Install GitHub App
3
You are redirected to GitHub — click Install and select which repos to grant access to
4
GitHub redirects back to rkito. The new integration appears in the table.
5
Click Sync repos to pull your repository list into rkito.

Common errors

state mismatch on callback
Browser session expired or the installation nonce was deleted. Start the installation flow again from rkito.
Installation succeeded but no integration appears in rkito
Check that the Webhook URL and Callback URL in GitHub App settings exactly match your API domain. Check API logs for [github-install-callback] entries.
Repos list is empty after sync
Ensure the GitHub App has been installed on the repositories you want. Go to your GitHub App → Install → select repositories.