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 Type | Description | Indexed Fields |
|---|---|---|
| Repositories | Code repos | name, description, readme |
| Issues | Bug reports, features | title, body, comments |
| Pull Requests | Code reviews | title, body, diff, reviews |
| Discussions | Q&A threads | title, body, answers |
| Wiki Pages | Documentation | title, 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 commitsissues- Issue changespull_request- PR changesdiscussion- 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
