Quick setup
1. Create GitHub Connector
- TypeScript
- Python
- cURL
OAuth Scopes: The GitHub connector requires these scopes:
repo- Access to private and public repositoriesuser:email- Access to user’s email addressadmin:repo_hook- Manage webhooks for incremental sync
2. Handle OAuth callback
Send the user toauthorization.url before authorization.expiresAt. After the user grants permissions, GitHub redirects to your redirectUrl. A pending OAuth connector is not visible in list or get until the user finishes authorization. Once it is visible, the user can select which repositories to sync.
3. Select Repositories
Unlike most connectors, GitHub requires repository selection before syncing begins. There are two ways to set it:- Hosted picker: read the connector with
include: "picker"and send the user topicker.url. The link works once and expires atpicker.expiresAt. - Direct selection: if you already know the repository ids, pass them in
selection.reposwithconnectors.update. A new selection replaces the old one and starts a sync.
See Managing Connector Selection for the generic selection API that GitHub, Gmail and Google Drive share.
- TypeScript
- Python
- cURL
The legacy
GET /v3/connections/{id}/resources repository listing has no v5 route. The hosted picker shows the user their repositories and saves the selection for you.Supported document types
The GitHub connector syncs documentation and text files with the following extensions:- Markdown files:
.md,.mdx,.markdown - Text files:
.txt - reStructuredText:
.rst - AsciiDoc:
.adoc - Org-mode:
.org
github_markdown document type in Supermemory.
Only text-based documentation files are synced. Binary files, images, and code files (
.js, .py, .go, etc.) are excluded by default to focus on searchable documentation content.Incremental sync with webhooks
The GitHub connector automatically sets up webhooks for real-time incremental syncing. When files are pushed or deleted in configured repositories, Supermemory is notified immediately.Batch Processing: Webhook events are processed in batches with a 10-minute delay to optimize performance and prevent excessive syncing during rapid commits. This means changes pushed to your repository will be reflected in Supermemory within approximately 10 minutes.
How it works
- Webhook Setup: When you set the selection, a webhook is automatically installed in each repository
- Push Events: When commits are pushed to the default branch, changed documentation files are synced
- Delete Events: When documentation files are deleted, they’re removed from your Supermemory knowledge base
- Incremental Updates: Only changed files are processed, keeping sync fast and efficient
Webhook security
Webhooks are secured using HMAC-SHA256 signature validation with constant-time comparison. Supermemory automatically validates that webhook events come from GitHub before processing them. Each repository gets a unique webhook secret for maximum security.- TypeScript
- Python
- cURL
Connector Management
List All Connectors
- TypeScript
- Python
- cURL
Update Repository Selection
You can update which repositories are synced at any time. The new selection replaces the old one and starts a sync.- TypeScript
- Python
- cURL
When you update the repository selection:
- New repositories are added and synced immediately
- Removed repositories have their webhooks deleted
- Existing documents from removed repositories remain in Supermemory unless you delete them manually
Delete Connector
- TypeScript
- Python
- cURL
Manual sync
Trigger a manual synchronization for all selected repositories. The call returns409 while a sync for that connector is already running.
- TypeScript
- Python
- cURL
Advanced configuration
Custom OAuth application
For white-label deployments or custom branding you can connect with your own GitHub OAuth app. Custom OAuth credentials are an organization setting and are not part of the v5 connector routes. See Custom OAuth Applications.Setting up a GitHub OAuth App:
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click “New OAuth App”
- Set Authorization callback URL to:
https://api.supermemory.ai/v3/connections/auth/callback/github - Copy the Client ID and generate a Client Secret