@octokit/rest
22.0.1 · 31 Oct 2025MIT27.9M / weekRepositoryHomepagenpmAtom feed
16.43.2 is the newest release of 16.x.
In short
10 breaking6 new7 fixed1 changed
- Breaking
All previously deprecated methods have been removed
- Breaking
Preview headers that are not required to use an API have been removed
- Breaking
.gitdata.getTags()has been removed. Use.gitdata.listRefs({namespace: tags})instead - Breaking
Methods for undocumented endpoints have been removed.
- Breaking
octokit.enterprise.*methods have been removed. They have been moved tot the@octokit/enterprise-restplugin - Breaking
octokit.issues.addLabelssendslabelsparameter with "labels" namespace instead of sending the array in the request body root. This is not supported by GitHub Enterprise 2.15 or older. You have several options. - Breaking
The
milestoneparameter is no longer validated using a regex as it cannot be derived from octokit/routes - Breaking
Dropped support for node 4
Release note
To upgrade to v16, make sure you have the latest v15 release installed first:
npm install @octokit/rest@15.18
Now run the tests and look for DEPRECATED messages in the logs. Once you see no more deprecations, upgrading to v16 should cause no problems.
Breaking changes
- Breaking
All previously deprecated methods have been removed
- Breaking
Preview headers that are not required to use an API have been removed
- Breaking
.gitdata.getTags()has been removed. Use.gitdata.listRefs({namespace: tags})instead - Breaking
Methods for undocumented endpoints have been removed.
Instead of
octokit.users.getById({id})useoctokit.request('GET /user/:id', {id})
Instead ofoctokit.repos.getById({id})useoctokit.request('GET /repositories/:id', {id}) - Breaking
octokit.enterprise.*methods have been removed. They have been moved tot the@octokit/enterprise-restplugin - Breaking
octokit.issues.addLabelssendslabelsparameter with "labels" namespace instead of sending the array in the request body root. This is not supported by GitHub Enterprise 2.15 or older. You have several options.Use the
@octokit/enterprise-restplugin loading all routes for the GHE version you want to supportUse
octokit.request()directly:
octokit.request('/repos/:owner/:repo/issues/:number/labels', { owner, repo, number, data: ['label1', 'label2'] }) - Breaking
The
milestoneparameter is no longer validated using a regex as it cannot be derived from octokit/routes - Breaking
Dropped support for node 4
- Breaking
Error.message is no longer a JSON string containing GitHub’s error message. Instead the JSON is parsed internally and error properties are assigned with its value. This is not technically a breaking change but a bug fix, but as this bug was around for a long time and plenty of apps depend on
JSON.parse(error.message)to be working, we treat it as a breaking change by way of precaution - Breaking
error.statusis now the response status code number. The status text is no longer returned
Features
.paginate(options, mapFn)
Octokit.paginate & octokit.paginate.iterator
Octokit.registerEndpoints()
Octokit.request & octokit.request.endpoint
Plugin API
Rename methods to align more closely to the documentation at developer.github.com/v3/ (10b4f34), closes /developer.github.com/v3/repos/commits/#get-the-sha-1
Bug Fixes
routes: remove validation for milestone parameter as it cannot be derived from octokit/routes
Only set preview headers required to use the API
Parse JSON from GitHub error messages
Continuous Integration
travis: drop tests in node 4 & 9, test in node 10
Bug Fixes in v16.0.1
typescript: Adding the
noImplicitAnyflag tovalidate:tstypescript: Github.plugin is a static method, not an instance method
typescript: include a
headerobject when transformingContent-TypeandContent-Lengthtoheaders.content-typeandheaders.content-length
Thanks @mamodom for your great help with these Typescript fixes 💐
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.