Skip to main content

GitHub

GitHub

GitHub Connector

Indexes repository content including source code, markdown, issues, and pull requests.

Accurate as of April 2026

Prerequisites - Before you start, make sure you have:


1. Create a GitHub OAuth App

Go to Register a new OAuth application on GitHub and fill in the form:

FieldValue
Application nameSercha (or any name you like)
Homepage URLhttp://localhost:3000
Application descriptionOptional - e.g. Unified Search
Authorization callback URLhttp://localhost:8080/api/v1/oauth/callback

Leave Enable Device Flow unchecked, then click Register application.

GitHub OAuth App registration form filled in with Sercha values
Fill in the OAuth App form with your Sercha instance URLs. The callback URL must point to the API on port 8080.
info

For more details on GitHub OAuth Apps, see the GitHub documentation on creating an OAuth App.

2. Copy the Client ID and generate a Client Secret

After registering, GitHub takes you to the app settings page. From here:

  1. Copy the Client ID shown on the page
  2. Click Generate a new client secret
GitHub app settings showing Client ID and Generate a new client secret button
Copy your Client ID, then click "Generate a new client secret".
  1. Copy the client secret immediately - GitHub only shows it once

Copy the secret now. GitHub will not show it again. If you lose it, you'll need to generate a new one.

GitHub showing the generated client secret with a warning to copy it
Copy the secret value before navigating away from this page.

3. Configure the provider

Add the credentials to your .env file (in your Sercha deployment directory):

.env
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret

4. Restart the backend

Restart the backend container so it picks up the new credentials:

Terminal
docker compose restart sercha-core
tip

No data is lost when restarting. The backend containers are stateless - all data is persisted in PostgreSQL and OpenSearch.

You can verify the provider is configured via List Providers:

curl
curl http://localhost:8080/api/v1/providers \
-H "Authorization: Bearer $TOKEN"

GitHub should show "configured": true, "enabled": true.


From here you can continue setup using either the Admin UI or the API.

5. Connect your GitHub account

Open http://localhost:3000/admin/sources in your browser. You'll see GitHub listed under the available providers. Click Connect on the GitHub row.

Sercha Sources page showing GitHub ready to connect
The Sources page shows all configured providers. Click "Connect" next to GitHub.

Your browser redirects to the GitHub consent page. Review the permissions and click Authorize.

GitHub OAuth consent page showing requested permissions
GitHub asks you to authorize the app. If you want to index repositories from an organization, click "Grant" next to it here.
tip

If you belong to any GitHub organizations, this page lets you Grant access to them. You'll only be able to index repositories from organizations you authorize here. You can update this later from your GitHub Authorized OAuth Apps settings.

After authorizing, you'll be redirected back to Sercha with a success confirmation.

Sercha showing Connected Successfully
The connection was created successfully.

6. Select repositories and create a source

Choose which repositories to index. Use the search bar to find specific repos, or click Select All. Then click Create Source.

Repository selection dialog showing available repos with checkboxes
Select the repositories you want to index and click "Create Source".

Your new source appears on the Sources page.

Sources page showing the newly created GitHub source
Your GitHub source now appears under "Connected Sources".

7. Trigger a sync

Click into your source, then click Sync Now to start indexing.

Source detail page with arrow pointing to Sync Now button
Click "Sync Now" to start indexing your selected repositories.

Once the sync completes, you'll see the indexed documents listed on the page.

Source detail page showing 45 indexed documents
Sync complete - your documents are now indexed and searchable.

What gets indexed

Source codeAll code files, respecting .gitignore rules
DocumentationREADME, markdown files, and docs
Issues & PRsIssue descriptions and pull request content (coming soon)
File metadataPath, size, and last modified timestamps

Scopes

The GitHub OAuth App requests repo, read:user, and user:email scopes.

Sync behavior

  • Initial sync: Fetches all files from selected repositories
  • Incremental sync: Detects changes since last sync using commit timestamps
  • Schedule: Automatic sync runs periodically (configurable)