Octokit plugin adding one method for all of api.github.com REST API endpoints
135
stars
959
commits
TypeScript
primary language
Sep 11, 2026
updated
Octokit plugin adding one method for all of api.github.com REST API endpoints
| Browsers |
Load
|
|---|---|
| Node |
Install with
|
const MyOctokit = Octokit.plugin(restEndpointMethods);
const octokit = new MyOctokit({ auth: "secret123" });
// https://developer.github.com/v3/users/#get-the-authenticated-user
octokit.rest.users.getAuthenticated();
There is one method for each REST API endpoint documented at https://developer.github.com/v3. All endpoint methods are documented in the docs/ folder, e.g. docs/users/getAuthenticated.md
[!IMPORTANT] As we use conditional exports, you will need to adapt your
tsconfig.jsonby setting"moduleResolution": "node16", "module": "node16".See the TypeScript docs on package.json "exports".
See this helpful guide on transitioning to ESM from @sindresorhus
Parameter and response types for all endpoint methods exported as { RestEndpointMethodTypes }.
Example
import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
type UpdateLabelParameters =
RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];
type UpdateLabelResponse =
RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
In order to get types beyond parameters and responses, check out @octokit/openapi-types, which is a direct transpilation from GitHub's official OpenAPI specification.
See CONTRIBUTING.md
TypeScript
98.7%
JavaScript
1.3%
Octokit plugin adding one method for all of api.github.com REST API endpoints
135
stars
959
commits
TypeScript
primary language
Sep 11, 2026
updated
Octokit plugin adding one method for all of api.github.com REST API endpoints
| Browsers |
Load
|
|---|---|
| Node |
Install with
|
const MyOctokit = Octokit.plugin(restEndpointMethods);
const octokit = new MyOctokit({ auth: "secret123" });
// https://developer.github.com/v3/users/#get-the-authenticated-user
octokit.rest.users.getAuthenticated();
There is one method for each REST API endpoint documented at https://developer.github.com/v3. All endpoint methods are documented in the docs/ folder, e.g. docs/users/getAuthenticated.md
[!IMPORTANT] As we use conditional exports, you will need to adapt your
tsconfig.jsonby setting"moduleResolution": "node16", "module": "node16".See the TypeScript docs on package.json "exports".
See this helpful guide on transitioning to ESM from @sindresorhus
Parameter and response types for all endpoint methods exported as { RestEndpointMethodTypes }.
Example
import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
type UpdateLabelParameters =
RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];
type UpdateLabelResponse =
RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
In order to get types beyond parameters and responses, check out @octokit/openapi-types, which is a direct transpilation from GitHub's official OpenAPI specification.
See CONTRIBUTING.md
TypeScript
98.7%
JavaScript
1.3%