Skip to main content
If you want to run Kody with a GitHub App, you need to create one. This app enables Kody to interact with your repositories, manage pull requests, and receive webhooks.
If you want to enable “Sign in with GitHub” for platform users, that’s a separate OAuth App process and doesn’t interfere with the GitHub App permissions. This guide focuses on the functional integration. See GitHub OAuth App.

Prerequisites

Have your application domains ready:
  • WEB_DOMAIN: Your Frontend URL (e.g., https://app.yourdomain.com or http://localhost:3000). Set NEXTAUTH_URL and API_FRONTEND_URL in your .env to the same URL.
  • WEBHOOK_DOMAIN: Public URL that reaches the webhooks service (e.g., https://kodus-webhooks.yourdomain.com). Your API domain works only if its reverse proxy routes /github/webhook to that service.

Step 1: Create the GitHub App

  1. On GitHub, go to Settings > Developer Settings > GitHub Apps
  2. Click New GitHub App
  3. Fill in the basic information (Name, Homepage URL) according to your preference

Step 2: Configure Callback and Setup URLs

This step is critical to ensure installation and redirection work properly. Fill in the fields below, replacing WEB_DOMAIN with your actual URL:
  • Callback URL:
    This URL is used to complete the authorization flow. Keep Allow wildcard matching checked on it: when someone connects the app, GitHub confirms they can access the installation and sends them back to WEB_DOMAIN/api/auth/callback/github/installation, a subdirectory of this URL. If you turn wildcard matching off, add that URL as a second Callback URL. Kodus builds that return URL from API_FRONTEND_URL, or from NEXTAUTH_URL when API_FRONTEND_URL is empty, so it must match your web URL. The installer’s .env.example sets API_FRONTEND_URL=http://localhost:3000; change it.
  • Setup URL:
  • Check the option: Redirect on update This ensures that after installing the app, users are redirected back to Kodus to complete the setup.

Step 3: Configure the Webhook

The webhook notifies Kodus about events in your pull requests.
Webhooks are handled by a separate service (port 3332). If you use the API domain here, ensure your reverse proxy routes /github/webhook to the webhooks service. Otherwise use a dedicated webhooks domain.
  • Webhook URL:
  • Make sure the Active option is checked
  • Leave Secret empty

Step 4: Set permissions and subscribe to events

Under Repository permissions, set: Under Organization permissions, set Members to Read-only. Kody uses it to list the organization’s members, for example in the PR author filters on Repositories. Contents write access is only needed for features that commit repository files; read-only is sufficient for reading code. Commit statuses is read only to use your CI results as review evidence; without it Kody sees check runs only. Install the app on the intended repositories and approve any newly requested permissions on existing installations. Under Subscribe to events, select:
  • Pull request
  • Pull request review comment
  • Issue comment
  • Push
  • Repository (optional): lets Kody set up a repository created after the app was installed with access to all repositories as soon as GitHub reports it, when Review every repository is on.
Kody ignores other events. GitHub still receives a 200 for them.

Merge queue

Kody only acts on a Push to a merge queue branch (gh-readonly-queue/...) and ignores every other push. GitHub’s merge queue tests each queued PR on that branch. On that push, Kody copies the PR’s last finished Kody Code Review result onto the queue commit, so the check can stay required with a merge queue. No new review runs, and no permission beyond Checks is needed. If the PR has no finished Kody review, the check fails and the queue removes the PR; see Troubleshooting.

Step 5: Collect Credentials and Add to .env

Now you need to get the credentials generated by GitHub and add them to your Kodus environment variables.

App ID

At the top of your app’s “About” page, copy the App ID. Add to your .env:

Client ID

On the same page, copy the Client ID. Add to your .env:

Client Secret

Go to the Client secrets section and click Generate a new client secret. Copy the generated value. Add to your .env:

Private Key

Scroll to the bottom of the page and click Generate a private key. This will download a .pem file. Open this file with a text editor and copy the entire content. Add to your .env:
Kodus accepts the key with its line breaks, or on one line with \n between the lines.

Installation URL

Open your GitHub App and click Install App. Copy the URL from the browser address bar (it looks like https://github.com/apps/<app-slug>/installations/new). Add to your .env:

Summary of Environment Variables

At the end, your configuration file should contain:
Click Save Changes on GitHub and restart your Kodus application to apply the changes.

Verify the connection

The webhook URL must reach the webhooks service, not the frontend login page. A 200 or 307 response alone does not prove correct delivery; see How to fix webhook issues for a request that does. Keep Redirect on update enabled. After installing or changing repository access, finish the Setup URL browser round trip back to Kodus. A successful ping or an ignored installation event does not create the Kodus integration. In Kodus, open Repositories in the sidebar and confirm that the expected repository is listed. Then open a test pull request and check both the GitHub delivery response and the Kodus webhooks and worker logs. If the connection is missing:
  • The person connecting must be able to see the installation on GitHub, for example an organization owner. Otherwise Kodus refuses the link.
  • An installation links to one Kodus organization. Connecting it to a second one is refused.
  • Start and finish the connection in the same browser within 10 minutes. After that GitHub’s authorization expires and you start again.
  • Check the installation’s repository access, the approved permissions, the Setup URL, the Callback URL and the proxy routing.
GitHub registration reference.