Quick Setup
1. Create GitHub Connection
- 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
After the user grants permissions, GitHub redirects to your callback URL. The connection is automatically established, and the user can now select which repositories to sync.3. List and Configure Repositories
Unlike other connectors, GitHub requires repository selection before syncing begins. This gives your users control over which repositories to index.- TypeScript
- Python
- cURL
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 configure repositories, 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
Connection Management
List All Connections
- TypeScript
- Python
- cURL
Update Repository Configuration
You can update which repositories are synced at any time:- TypeScript
- Python
- cURL
When you update the repository configuration:
- 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 Connection
- TypeScript
- Python
- cURL
Manual Sync
Trigger a manual synchronization for all configured repositories:- TypeScript
- Python
- cURL
Advanced Configuration
Custom OAuth Application
For white-label deployments or custom branding, configure your own GitHub OAuth app using the settings API:- TypeScript
- Python
- cURL
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
- Configure them in Supermemory using the settings API above