Gathering detailed insights and metrics for @octokit/plugin-retry
Gathering detailed insights and metrics for @octokit/plugin-retry
Gathering detailed insights and metrics for @octokit/plugin-retry
Gathering detailed insights and metrics for @octokit/plugin-retry
Octokit plugin for GitHub’s recommended request retries
npm install @octokit/plugin-retry
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (88.17%)
JavaScript (11.83%)
Total Downloads
231,450,632
Last Day
516,794
Last Week
2,824,574
Last Month
13,635,135
Last Year
119,350,649
MIT License
48 Stars
637 Commits
23 Forks
11 Watchers
9 Branches
26 Contributors
Updated on Jun 30, 2025
Latest Version
8.0.1
Package Id
@octokit/plugin-retry@8.0.1
Unpacked Size
15.51 kB
Size
4.76 kB
File Count
13
NPM Version
10.9.2
Node Version
22.15.0
Published on
May 20, 2025
Cumulative downloads
Total Downloads
Last Day
-1%
516,794
Compared to previous day
Last Week
-10.7%
2,824,574
Compared to previous week
Last Month
14.3%
13,635,135
Compared to previous month
Last Year
61%
119,350,649
Compared to previous year
Retries requests for server 4xx/5xx responses except
400
,401
,403
,404
,410
,422
, and451
.
Browsers |
Load
|
---|---|
Node |
Install with
|
[!IMPORTANT] As we use conditional exports, you will need to adapt your
tsconfig.json
by setting"moduleResolution": "node16", "module": "node16"
.See the TypeScript docs on package.json "exports".
See this helpful guide on transitioning to ESM from @sindresorhus
1const MyOctokit = Octokit.plugin(retry); 2const octokit = new MyOctokit({ auth: "secret123" }); 3 4// retries request up to 3 times in case of a 500 response 5octokit.request("/").catch((error) => { 6 if (error.request.request.retryCount) { 7 console.log( 8 `request failed after ${error.request.request.retryCount} retries`, 9 ); 10 } 11 12 console.error(error); 13});
To override the default doNotRetry
list:
1const octokit = new MyOctokit({ 2 auth: "secret123", 3 retry: { 4 doNotRetry: [ 5 /* List of HTTP 4xx/5xx status codes */ 6 ], 7 }, 8});
To override the number of retries:
1const octokit = new MyOctokit({ 2 auth: "secret123", 3 request: { retries: 1 }, 4});
You can manually ask for retries for any request by passing { request: { retries: numRetries, retryAfter: delayInSeconds }}
. Note that the doNotRetry
option from the constructor is ignored in this case, requests will be retried no matter their response code.
1octokit 2 .request("/", { request: { retries: 1, retryAfter: 1 } }) 3 .catch((error) => { 4 if (error.request.request.retryCount) { 5 console.log( 6 `request failed after ${error.request.request.retryCount} retries`, 7 ); 8 } 9 10 console.error(error); 11 });
Pass { retry: { enabled: false } }
to disable this plugin.
See CONTRIBUTING.md
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
SAST tool is run on all commits
Details
Reason
security policy file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More