axios-retry

Axios plugin that automatically retries failed HTTP requests with configurable conditions and backoff strategies.

Library
npm
v4.5.0
2,014stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
41/100Fair
Development Activity0
Maintenance0
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
70/100Good
Architecture78
Code Quality85
Innovation80
Learning Curve35

axios-retry is a lightweight plugin that hooks into Axios’s interceptor chain to automatically retry failed HTTP requests, handling transient network errors and 5xx server responses without requiring extra application code at every call site.

Maintained by Softonic, it exposes configurable retry conditions, multiple delay strategies (no-delay, linear, exponential backoff with jitter), Retry-After header support, and per-request overrides, and is downloaded over 9 million times a week across the npm ecosystem.

What You Get

  • Automatic retry interceptors that plug into any Axios instance or the global axios object
  • Built-in retry condition helpers for network errors, safe methods, and idempotent methods
  • Exponential backoff and linear delay strategies with jitter, plus support for a fully custom delay function
  • Retry-After header support that respects server-specified backoff windows
  • Per-request retry overrides via the axios-retry request config key

Common Use Cases

  • Automatically retrying failed GET requests against unreliable third-party APIs
  • Backing off exponentially when a backend service returns 5xx errors under load
  • Respecting Retry-After headers when calling rate-limited REST APIs
  • Refreshing auth tokens and retrying the original request on 401 responses

Under The Hood

Architecture The library is a single-file module (src/index.ts, ~340 lines) built around a functional/closure design: axiosRetry() registers a request and response interceptor pair via axiosInstance.interceptors, tracking per-request state by stashing a currentState object on config['axios-retry'], threading retryCount/lastRequestTime through Axios’s own config-merging behavior rather than an external store or class hierarchy. Retry decision (shouldRetry), retry execution (handleRetry), and max-retry escalation (handleMaxRetryTimesExceeded) are separated into focused async functions; delay strategies and retry-condition predicates are exported as free functions so callers can compose custom behavior without touching the core interceptor logic. The entire public surface is a single default-exported function with static properties attached for CommonJS interop. The core abstraction is the per-request state object threaded through Axios’s config object, which means the library is tightly coupled to that one specific Axios internal behavior continuing to hold.

Tech Stack Written in TypeScript, targeting dual ESM/CJS output via two tsconfig variants, built through raw tsc (no bundler) into dist/esm and dist/cjs with hand-written package.json stubs marking module type. The only runtime dependency is is-retry-allowed, used to filter out non-retryable errno codes; Axios itself is a peer dependency rather than a hard dependency, so consumers bring their own Axios version. Dev tooling includes ESLint plus typescript-eslint and Prettier for style, Husky and lint-staged for pre-commit gating, and ts-node running a Jasmine test suite against nock-mocked HTTP responses, with a single GitHub Actions workflow for CI.

Code Quality The test suite is a single, dense Jasmine spec file using nock to mock HTTP responses, with comprehensive coverage of retry conditions, delay functions, Retry-After handling, timeout interaction, and abort-signal behavior. Error handling favors typed AxiosError throughout, with explicit optional chaining rather than silent failure; the one broad catch deliberately falls back to a safe default for compatibility, and this is documented inline. Naming is consistent and intention-revealing, type safety is strong with dedicated interfaces plus module augmentation of Axios’s own config type, and linting/formatting is enforced both locally via pre-commit hooks and in CI.

API Design The public API is a single function call with zero required configuration, so the default case is a one-liner while advanced users can import the individual delay functions and condition predicates to compose custom retry behavior without forking the library. The README documents every option in one table with runnable examples for each delay strategy, and TypeScript types augment Axios’s own request config so editors surface autocomplete on the retry config key without extra work from the consumer.

Used by 8 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

24,298

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript99%
Updated today
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,893

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript100%
Updated 3 days ago
TypeScript
97%
Other

Infisical

Security · Devops

29,145

The open-source platform for secrets, certificates, privileged access, and AI agent security — all in one self-hostable system.

View details
91
Repo Health
84
Technical
65
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
86%
MIT

medusa

Ecommerce

36,163

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
93
Repo Health
87
Technical
63
Dependency
Built with
TypeScript86%
JavaScript14%
Updated 2 days ago
TypeScript
91%
MIT

SerpBear

Marketing · Analytics

2,065

Self-hosted keyword rank tracker with Google Search Console integration, multi-provider SERP scraping, and a built-in REST API.

View details
49
Repo Health
67
Technical
68
Dependency
Built with
TypeScript91%
Updated 3 months ago
TypeScript
80%
Other

twenty

CRM

56,361

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript80%
MDX17%
Updated yesterday
Go
54%
AGPL 3.0

Uptrace

Monitoring · Devops

4,279

Unified open-source APM that collects OpenTelemetry traces, metrics, and logs into a single self-hosted platform backed by ClickHouse.

View details
62
Repo Health
70
Technical
64
Dependency
Built with
Go54%
Vue34%
Updated 3 weeks ago
TypeScript
95%
GPL 3.0

Wire

Team Chat · Video Conferencing · Collaboration

1,191

Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.

View details
93
Repo Health
8
Technical
71
Dependency
Built with
TypeScript95%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search