GitHubKit is a comprehensive, type-hinted SDK for interacting with the GitHub REST API and GraphQL API, and for parsing webhooks. It supports the latest GitHub API versions and provides a consistent interface for various GitHub features. The current version is 0.15.3, with frequent releases often driven by updates to GitHub's OpenAPI specification.
pip install githubkitVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the GitHubKit client with a Personal Access Token (PAT) and make a simple REST API call to fetch the authenticated user's details and their repositories. Ensure `GITHUB_TOKEN` is set in your environment.
Review your API calls and ensure compatibility with GitHub REST API version 2026-03-10. If necessary, you can explicitly set an older API version when initializing the client, e.g., `GitHub(token, api_version='2022-11-28')`.
Initialize your `GitHub` client once at the application startup or within a global scope (e.g., as a global variable, dependency injection, or FastAPI `Depends`) and pass the same instance to all functions or methods that need to interact with the GitHub API.
Always use `githubkit.webhooks.parse_webhook(payload, signature, secret)` and ensure you pass the correct webhook secret configured in your GitHub App or repository settings. The `parse_webhook` function handles the signature verification automatically and raises an error if it fails.
Implement robust error handling for `githubkit.exception.RateLimitError`. Consider using a retry mechanism with exponential backoff, or consult the `x-ratelimit-reset` header to know when the rate limit will reset and pause requests accordingly.
Install `githubkit` using pip: `pip install githubkit` or poetry: `poetry add githubkit`, and verify the import statement is `from githubkit import GitHub`.
Ensure you are using a valid GitHub Personal Access Token (PAT) with the necessary scopes, or correctly configure another authentication strategy (e.g., GitHub App) as described in the `githubkit` documentation.
Update your code to reflect the new model structure by consulting the latest `githubkit` documentation, changelog, or the official GitHub API documentation for the specific endpoint you are using.
Verify that the webhook secret configured in GitHub matches the secret used in `githubkit.webhooks.verify()`, and ensure the raw request body and headers are passed to the verification function without any modifications.
Ensure you are using Pydantic v2 (recommended by `githubkit`) and review the specific `ValidationError` message to identify the missing or malformed field. Update your code to handle the expected schema or ensure the incoming payload conforms to the expected structure.