Skip to main content

Context7 needs access to your GitHub repositories to clone and index them. You can connect GitHub in two ways: a GitHub App (recommended) or a personal access token. The GitHub App additionally delivers push webhooks, which power push-triggered GitOps syncs.

Both are configured under Workspace Settings › GitHub.

Note

Running GitHub Enterprise Server instead of github.com? Point Context7 at your server first. See GitHub Enterprise Server.

GitHub App#

The GitHub App is the recommended option. It gives Context7 fine-grained access to only the repositories you select, rotates short-lived access tokens automatically, and delivers webhooks for push-triggered GitOps syncs.

Connecting the App is two steps: first create the App, then install it on your repositories.

Create the App

Go to Workspace Settings › GitHub and choose Create GitHub App in the GitHub App row. Context7 generates a pre-filled App manifest and sends you to GitHub to create the App in one click. You are redirected back and Context7 stores everything it needs automatically: the App ID, private key, client ID and secret, and the webhook secret.

Install the App

After it is created, install the App on the account or organization that owns your repositories, and grant it access to the repositories you want to index (including your GitOps manifest repository, if you use GitOps).

Once both steps are done, the GitHub App row shows the connected App and its installation:

Connected GitHub App with one installation under Workspace Settings, GitHub

Verify the App configuration#

The setup flow configures everything below automatically, so a newly created App is ready to use. The exception is an instance on localhost or 127.0.0.1: GitHub cannot reach a local address, so the manifest has no webhook and no push event. Add them by hand when the instance has a reachable URL. Use this section to confirm the App, or to fix an App you connected before GitOps existed (it will be missing the push event; see Webhooks). Open the App at github.com/settings/apps.

SettingRequired value
Repository permission: ContentsRead-only
Repository permission: MetadataRead-only (mandatory)
Subscribed eventsPush
WebhookActive
Webhook URLhttps://<your-host>/api/github/webhook
Webhook secretSet
Callback URLhttps://<your-host>/api/github/callback
Setup URLhttps://<your-host>/api/github/setup

Under Permissions & events, the repository permissions are granted and the Push event is subscribed:

GitHub App repository permissions and the subscribed Push event

Under Webhook, it is active and points at your instance with a secret configured:

GitHub App webhook settings: active, webhook URL, and a configured secret

Personal access token#

As a simpler alternative, add a GitHub personal access token in the GitHub token row under Workspace Settings › GitHub. Use a token with the repo scope for private repository access.

GitHub token fields under Workspace Settings, GitHub

A personal access token can clone and index repositories, but it cannot receive webhooks. With a token only, push-triggered GitOps syncs are unavailable; use the GitOps sync schedule or trigger syncs from CI instead.

GitHub Enterprise Server#

Context7 works with GitHub Enterprise Server, not only github.com. Set your server host before you create the GitHub App or add a token, so the App is created on your own server instead of github.com.

Set your GitHub Enterprise host

Open Workspace Settings › GitHub, open the GitHub token row, and select Enterprise Server. Enter your server host in Server URL, for example github.your-company.com (no https://), then choose Save and apply.

GitHub token row with Enterprise Server selected under Workspace Settings, GitHub

Create the App or add a token

Now follow GitHub App or Personal access token above. The App manifest, installation, sign-in, and all API calls target your server. Before you create the App, the GitHub App card shows the server it will use, so you can confirm it is not github.com.

For this to work, Context7 must reach your server’s API at https://<your-host>/api/v3, and your server must reach Context7 at its webhook URL for push delivery.

Webhooks#

When the GitHub App is connected, GitHub delivers push events to https://<your-host>/api/github/webhook. Context7 verifies each delivery’s signature against the App’s webhook secret and uses pushes to drive GitOps reconciliation: a push to a GitOps manifest repository triggers an immediate sync.

For delivery to work:

  • Context7 must hold the App’s webhook secret. Create GitHub App stores it for you; with no secret, Context7 cannot verify the sender and refuses every delivery. An App created while the instance ran on localhost has no webhook secret; once the instance has a reachable URL, recreate the App from Workspace Settings › GitHub instead of adding the webhook by hand.
  • Your instance must be reachable from GitHub at the webhook URL. An instance behind a firewall that GitHub cannot reach will not receive webhooks.
  • The App must be subscribed to push events (new App setups are configured this way automatically).
Warning

GitHub Apps created before push support was added are not subscribed to any events, so they do not deliver webhooks. If you set up the App earlier, open it on GitHub and add the push event under its event subscriptions, confirm its webhook URL is https://<your-host>/api/github/webhook, or recreate the App from Workspace Settings › GitHub.