Java 21 libraries for working with GitHub: call the REST or GraphQL API, wrap it in objects, and receive webhooks. Each one works on its own, and they fit together.
Unofficial. These projects are not affiliated with or endorsed by GitHub.
| Library | What it does | Maven Central |
|---|---|---|
| github-sdk | Immutable objects over the REST client: repository.createIssue(...), issue.close(), pullRequest.merge(). |
|
| github-rest-client | Typed client for the GitHub REST API: github.com, Enterprise Cloud and Enterprise Server, with pagination and rate-limit handling built in. | |
| github-webhook | Typed webhook events (a record for every documented event), a decoder, and a receiver that verifies the signature before it parses anything. | |
| github-graphql-client | Typed client for the GitHub GraphQL API: a query is a lambda over generated selectors, with mutations and auto-paging. | |
| github-client | The transport under the REST and GraphQL clients: authentication, retries, rate limits, error mapping and pagination. |
github-sdk
- Objects with methods:
repository.createIssue(...),issue.close(),pullRequest.merge(). - Immutable objects,
Optionallookups that are empty on 404, and lazy streams for lists. - One request for many changes:
update(),protect()andcommitTo(branch)collect fields and send them together. - Every object keeps the complete client record in
response(), so you can drop back to the client at any point.
github-rest-client
- Generated from GitHub's own OpenAPI descriptions, so every resource has a typed
GitHub*Apiclass. - One client for github.com, Enterprise Cloud and Enterprise Server.
- A value GitHub adds later decodes to
UNRECOGNIZEDinstead of failing your code. - Rate limits are waited out, pagination is followed and responses are immutable.
github-graphql-client
- Generated from GitHub's own GraphQL schema: a query is a lambda over selectors, and the query sent contains exactly the fields the lambda reads.
- Mutations, input records with builders, interfaces and unions, and
paginatefor a lazyStreamof every page. - A value GitHub adds later reads as
UNRECOGNIZEDinstead of failing your code.
github-client
- The transport the REST and GraphQL clients share: bearer, basic and GitHub App authentication, retries, and primary and secondary rate limits.
- Typed exceptions for failed responses, and lazy pagination with loop detection.
- You do not need it directly: both clients bring it.
github-webhook
- A record for every documented event (313 events in 88 families), and a sealed interface per family, so the compiler
checks your
switch. - The receiver checks the signature against the raw body before it parses anything.
- A new event, action or field never fails decoding.
- No HTTP client and no dependency on the REST client.
- github-sdk is the quickest way in: objects with methods, on top of the REST client. You can drop back to the client for a call it does not cover.
- github-rest-client is the base under it. Use it alone when you want every endpoint as a typed call.
- github-graphql-client is the same idea for the GraphQL API: use it when you want to fetch exactly the fields you read.
- github-client is the transport under both clients. It is not something you pick, because they bring it.
- github-webhook has no dependency on the others. Use it to receive events, then act on them with the SDK or the client.
- Call the API, with less code: github-sdk (it brings the client).
- Call the API, with full coverage: github-rest-client.
- Fetch exactly the fields you need: github-graphql-client.
- React to things that happen on GitHub: github-webhook.
- A bot that reacts and then acts: the webhook library and the SDK or a client.