Providers
GitHub
GitHub Provider
Interact with GitHub's REST API v3 with automatic normalization.
Boundary's GitHub provider normalizes GitHub's REST API v3 and includes automatic rate limit handling.
Configuration
const boundary = new Boundary({
providers: {
github: {
auth: {
token: process.env.GITHUB_TOKEN,
type: "token"
},
// Optional: Fine-tune resilience
retry: {
maxRetries: 3
}
}
}
});Available Methods
get(endpoint, options?)post(endpoint, options?)put(endpoint, options?)patch(endpoint, options?)delete(endpoint, options?)paginate(endpoint, options?)- Automatically handles pagination traversal
Rate Limiting
GitHub enforces rate limits based on authentication type:
- Authenticated: 5,000 requests/hour
- Unauthenticated: 60 requests/hour
Automatic Handling
Boundary automatically tracks remaining requests and respects reset times. It will anticipate rate limit errors and can be configured to wait automatically.
Example: Handling Limits
try {
const { data, meta } = await boundary.github.get("/users/octocat/repos");
console.log(`Remaining: ${meta.rateLimit.remaining}`);
} catch (error) {
if (error instanceof RateLimitError) {
console.log(`Reset at: ${error.resetAt}`);
}
}On this page
- Overview