GitHub Integration

Connect GitHub repositories, issues, and pull requests to Metalogue

GitHub Integration

Connect your GitHub organization to index repositories, issues, pull requests, discussions, and wikis.

Quick Start

const connector = await client.createConnector({
  connector_type: 'github',
  display_name: 'Company GitHub',
  credentials: {
    access_token: 'ghp_xxxxxxxxxxxx',
  },
});

await client.syncConnector(connector.connector_id, true);

Authentication

OAuth 2.0 (Recommended)

GET /v1/connectors/github/oauth-url

Returns the authorization URL. After user authorization, Metalogue handles token exchange.

Personal Access Token

{
  "credentials": {
    "access_token": "ghp_xxxxxxxxxxxx"
  }
}

Required scopes: repo, read:org, read:discussion

Synced Content

Content TypeDescriptionIndexed Fields
RepositoriesCode reposname, description, readme
IssuesBug reports, featurestitle, body, comments
Pull RequestsCode reviewstitle, body, diff, reviews
DiscussionsQ&A threadstitle, body, answers
Wiki PagesDocumentationtitle, content

Configuration

{
  "settings": {
    "sync_private_repos": true,
    "sync_archived_repos": false,
    "include_forks": false,
    "max_file_size_mb": 10,
    "file_extensions": [".md", ".txt", ".rst"]
  }
}

Webhooks

Enable real-time sync via GitHub webhooks:

POST /v1/connectors/{connector_id}/webhook

Supported events:

  • push - New commits
  • issues - Issue changes
  • pull_request - PR changes
  • discussion - Discussion updates

Example Queries

// Find all PRs mentioning authentication
const results = await client.query({
  text: 'authentication implementation',
  filters: {
    connector_type: 'github',
    document_type: 'pull_request'
  }
});

Rate Limits

  • API calls: 5,000/hour with OAuth
  • Built-in backoff and retry logic

Next Steps