GUIDESetupGitHub
GitHub Integration
Connect rkito to GitHub to enable repo ingestion, automatic Design Audit on pull requests, and architecture manifest write-back.
Before you start
- A GitHub account with admin access to create an app
- Your API domain
- OpenSSL, to generate the webhook secret
What rkito uses GitHub for
| Feature | Mechanism |
|---|---|
| Repo ingestion | App installation — reads repo file tree |
| Design Audit | PR webhook → triggers AI review on open/sync |
| Architecture manifest | App installation — commits .rkito/architecture.yaml |
| Org webhooks | Webhook on installation events |
Create the GitHub App
- Go to
GitHub → Settings → Developer settings → GitHub Apps → New GitHub App - Fill in the required fields:
Field Value GitHub App name rkito (or rkito-dev for dev) Homepage URL https://app.yourdomain.com Callback URL https://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 URL https://api.yourdomain.com/api/v1/integrations/githubs/orgwebhook Webhook secret Generate with: openssl rand -hex 32 (save this)
Repository permissions
| Permission | Level |
|---|---|
| Contents | Read & write |
| Metadata | Read-only |
| Pull requests | Read & write |
| Commit statuses | Read & write |
Organisation permissions
| Permission | Level |
|---|---|
| Members | Read-only |
Subscribe to events
Check: Pull request, Push, Installation, Installation repositories
Generate a private key
- In your new app, scroll to
Private keys → Generate a private key - A
.pemfile downloads automatically. Store its contents inapi/.env
Set environment variables
Add the following to api/.env:
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/callbackURL reference
| URL | Purpose |
|---|---|
| /api/v1/integrations/githubs/installations/callback | Processes OAuth code after GitHub redirects back, stores the installation |
| /api/v1/integrations/githubs/orgwebhook | Receives pull_request, push, installation events from GitHub |
| /api/v1/auth/github/callback | User login via GitHub OAuth (separate from App installation) |
Connect from rkito
- In rkito, navigate to your org →
Integrations → GitHub - Click
+ Connect→ enter your GitHub account name → clickInstall GitHub App - You are redirected to GitHub — click
Installand select which repos to grant access to - GitHub redirects back to rkito. The new integration appears in the table.
- Click
Sync reposto pull your repository list into rkito.
Troubleshooting
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.
Was this guide helpful?