GitHub Connector
Connect your GitHub repositories to Brevo for developer engagement tracking, release notification workflows, and community activity monitoring through Tajo.
Overview
| Property | Value |
|---|---|
| Platform | GitHub |
| Category | Custom |
| Setup Complexity | Moderate |
| Official Integration | No |
| Data Synced | Events, Users, Repositories |
| API Type | REST API, GraphQL API |
| Authentication | GitHub App / Personal Access Token / OAuth 2.0 |
| Base URL | https://api.github.com |
| API Version | 2022-11-28 (header-based versioning) |
Features
- Issue and PR tracking - Sync issue and pull request events to Brevo contact timelines
- Release notifications - Trigger Brevo campaigns on new repository releases
- Contributor sync - Map GitHub contributors to Brevo contacts for community engagement
- Star and fork tracking - Monitor repository popularity metrics
- Webhook event forwarding - Forward GitHub events to Brevo automations
- Repository catalog - Sync repository metadata as Brevo catalog items
Prerequisites
Before you begin, ensure you have:
- A GitHub account with access to target repositories
- A GitHub App or Personal Access Token (fine-grained recommended)
- Admin access to repositories for webhook configuration
- A Brevo account with API access
- A Tajo account with an active subscription
Authentication
GitHub supports multiple authentication methods. Tajo recommends using GitHub Apps for organization-level access.
Option 1: GitHub App (Recommended)
- Navigate to Settings > Developer settings > GitHub Apps
- Click New GitHub App
- Configure the app with these permissions:
Repository permissions: Issues: Read Pull requests: Read Contents: Read Metadata: Read
Organization permissions: Members: Read
Subscribe to events: Issues Pull request Push Release Star ForkOption 2: Fine-Grained Personal Access Token
- Go to Settings > Developer settings > Personal access tokens > Fine-grained tokens
- Click Generate new token
- Select target repositories
- Grant these permissions:
Repository access: Selected repositoriesPermissions: Issues: Read-only Pull requests: Read-only Contents: Read-only Metadata: Read-onlyToken Security
Fine-grained tokens have expiration dates. Set up token rotation before expiry. GitHub App installation tokens auto-refresh and are preferred for production use.
Connecting to Tajo
# Using GitHub Apptajo connectors install github \ --app-id $GITHUB_APP_ID \ --private-key-path ./github-app-key.pem \ --installation-id $GITHUB_INSTALLATION_ID
# Using Personal Access Tokentajo connectors install github \ --token $GITHUB_TOKENConfiguration
Basic Setup
connectors: github: enabled: true auth_type: "github_app" # or "token"
repositories: - owner/repo-1 - owner/repo-2
sync: issues: true pull_requests: true releases: true contributors: true stars: true
lists: contributors: 20 stargazers: 21Field Mapping
Map GitHub user data to Brevo contact attributes:
field_mapping: # Standard fields login: GITHUB_USERNAME email: email name: FIRSTNAME
# Developer metrics contributions: GITHUB_CONTRIBUTIONS repositories_count: GITHUB_REPOS followers: GITHUB_FOLLOWERS created_at: GITHUB_JOINED
# Custom attributes company: COMPANY location: LOCATION bio: GITHUB_BIOAPI Endpoints
Tajo integrates with the following GitHub REST API endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/repos/{owner}/{repo}/issues | GET | List repository issues |
/repos/{owner}/{repo}/pulls | GET | List pull requests |
/repos/{owner}/{repo}/releases | GET | List releases |
/repos/{owner}/{repo}/contributors | GET | List contributors |
/repos/{owner}/{repo}/stargazers | GET | List stargazers |
/repos/{owner}/{repo}/forks | GET | List forks |
/repos/{owner}/{repo}/events | GET | List repository events |
/users/{username} | GET | Get user profile |
/orgs/{org}/members | GET | List organization members |
/repos/{owner}/{repo}/hooks | POST | Create webhook |
Code Examples
Initialize Connector
import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({ apiKey: process.env.TAJO_API_KEY, brevoApiKey: process.env.BREVO_API_KEY});
await tajo.connectors.connect('github', { appId: process.env.GITHUB_APP_ID, privateKey: process.env.GITHUB_PRIVATE_KEY, installationId: process.env.GITHUB_INSTALLATION_ID});Sync Contributors to Brevo
await tajo.connectors.sync('github', { type: 'full', resources: ['contributors'], repositories: ['owner/repo-1', 'owner/repo-2']});
const status = await tajo.connectors.status('github');console.log(status);// {// connected: true,// lastSync: '2024-03-15T11:00:00Z',// contributorsCount: 245,// issuesTracked: 1890,// releasesTracked: 34// }Handle Webhook Events
app.post('/webhooks/github', async (req, res) => { const signature = req.get('X-Hub-Signature-256'); const event = req.get('X-GitHub-Event');
// Verify webhook signature if (!verifyGitHubSignature(req.body, signature)) { return res.status(401).send('Unauthorized'); }
await tajo.connectors.handleWebhook('github', { event, payload: req.body });
res.status(200).send('OK');});Trigger Release Campaign
// Listen for new releases and trigger Brevo campaigntajo.connectors.on('github', 'release.published', async (event) => { await tajo.campaigns.trigger('release-announcement', { listId: 21, params: { version: event.release.tag_name, release_notes: event.release.body, download_url: event.release.html_url } });});Rate Limits
GitHub enforces rate limits based on authentication method:
| Authentication | Primary Rate Limit | Search API |
|---|---|---|
| Unauthenticated | 60 requests/hour | 10 requests/minute |
| Personal Access Token | 5,000 requests/hour | 30 requests/minute |
| GitHub App (installation) | 5,000 requests/hour | 30 requests/minute |
| GitHub App (user-to-server) | 5,000 requests/hour | 30 requests/minute |
Conditional Requests
Tajo uses conditional requests (If-None-Match / If-Modified-Since headers) to reduce API consumption. Responses with 304 Not Modified do not count against rate limits.
Additional limits:
- Secondary rate limits: No more than 100 concurrent requests. No more than 900 points per minute for REST API endpoints.
- GraphQL: 5,000 points per hour (query cost varies by complexity).
Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Expired token or wrong credentials | Regenerate token or reinstall GitHub App |
| 403 Forbidden | Insufficient permissions | Check token scopes or App permissions |
| 404 Not Found | Private repo without access | Grant repository access to token or App |
| Rate limit exceeded | Too many API calls | Enable conditional requests and reduce sync frequency |
| Webhooks not received | Incorrect URL or firewall | Verify webhook URL is publicly accessible |
Debug Mode
connectors: github: debug: true log_level: verbose log_webhooks: trueTest Connection
tajo connectors test github# ✓ API authentication successful# ✓ Repository access verified# ✓ Issue data readable# ✓ Webhook delivery active# ✓ Rate limit healthy (4,850/5,000 remaining)Best Practices
- Use GitHub Apps over PATs - GitHub Apps provide granular permissions and auto-refreshing tokens
- Enable webhook secrets - Always verify webhook signatures with HMAC-SHA256
- Use conditional requests - Leverage ETags to avoid wasting rate limit quota
- Paginate large responses - GitHub returns max 100 items per page; iterate with
Linkheaders - Sync during low activity - Schedule full syncs outside peak development hours
- Monitor rate limit headers - Check
X-RateLimit-Remainingto proactively throttle
Security
- GitHub App Authentication - RSA key-based JWT with short-lived installation tokens
- Webhook Signatures - HMAC-SHA256 signature verification on all webhook payloads
- Fine-Grained Tokens - Scoped to specific repositories and permissions
- HTTPS Only - All API communication encrypted via TLS 1.2+
- Encrypted Storage - Private keys and tokens encrypted at rest in Tajo
- Token Expiration - Fine-grained tokens auto-expire; set up rotation alerts
Related Resources
Open-Source Implementation Map
This section is derived from official or public repository material discovered for the GitHub connector. Use it as the engineering companion to the setup guide above: it shows where the API surface lives, what implementation assets exist, and how Tajo should translate them into reliable Brevo sync behavior.
Repository Snapshot
| Repository | Commit | Languages / formats | Files |
|---|---|---|---|
| github/rest-api-description | 88dc3d8 | JSON (170), YAML (168), Markdown (12), YAML (10), gitignore (1), txt (1) | 362 |
Integration Shape
graph LR Source["GitHub API / repository"] --> Auth["Auth and scopes"] Source --> Objects["Objects, events, and schemas"] Auth --> Tajo["Tajo connector runtime"] Objects --> Tajo Tajo --> Brevo["Brevo contacts, attributes, lists, campaigns"] Tajo --> Ops["Backfill, cursor, retries, logs"]What To Reuse
- GitHub’s REST API OpenAPI Description
- This repository contains OpenAPI descriptions for GitHub’s REST API.
- What is OpenAPI?
- From the OpenAPI Specification:
- Project Status
Tajo Revamp Checklist
- Keep authentication setup aligned with the vendor docs and the public repository’s current API shape.
- Map primary resources into explicit Tajo sync objects with stable external IDs.
- Prefer cursor-based or updated-at incremental sync where the API exposes it; otherwise document the fallback.
- Treat webhook handlers as idempotent and replay-safe, especially for order, contact, ticket, and campaign events.
- Capture pagination, rate limits, retry headers, and partial-failure behavior in connector smoke tests.
- Keep examples small and runnable against sandbox or test-mode accounts.