{"id":48517952,"url":"https://github.com/samplexbro/axios-retryer","last_synced_at":"2026-04-07T20:01:19.002Z","repository":{"id":270722615,"uuid":"905162820","full_name":"sampleXbro/axios-retryer","owner":"sampleXbro","description":"An advanced Axios request manager offering intelligent retry logic with token refresh, concurrency control, priority queuing, and a flexible plugin architecture, all built with TypeScript for robust HTTP client integrations.","archived":false,"fork":false,"pushed_at":"2025-06-04T12:40:34.000Z","size":611,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T09:06:26.416Z","etag":null,"topics":["axios","concurrency","http-client","priority-queue","queue","retry-library","retryer","token-refresh"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sampleXbro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-12-18T09:32:59.000Z","updated_at":"2025-08-05T11:18:39.000Z","dependencies_parsed_at":"2025-02-03T10:20:17.253Z","dependency_job_id":"91d60088-80ef-4669-a8f2-6a3b4e5ce89a","html_url":"https://github.com/sampleXbro/axios-retryer","commit_stats":null,"previous_names":["samplexbro/axios-retryer"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/sampleXbro/axios-retryer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampleXbro%2Faxios-retryer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampleXbro%2Faxios-retryer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampleXbro%2Faxios-retryer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampleXbro%2Faxios-retryer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sampleXbro","download_url":"https://codeload.github.com/sampleXbro/axios-retryer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampleXbro%2Faxios-retryer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31526666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axios","concurrency","http-client","priority-queue","queue","retry-library","retryer","token-refresh"],"created_at":"2026-04-07T20:00:34.240Z","updated_at":"2026-04-07T20:01:18.992Z","avatar_url":"https://github.com/sampleXbro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/axios-retryer-logo.png\" alt=\"axios-retryer logo\" width=\"96\" /\u003e\n  \u003ch1\u003eaxios-retryer\u003c/h1\u003e\n  \u003cp\u003e\u003cstrong\u003eTypeScript-first Axios retry library with concurrency control, request prioritization, token refresh, response caching, circuit breaker, and more — as composable plugins.\u003c/strong\u003e\u003c/p\u003e\n\n  [![npm version](https://img.shields.io/npm/v/axios-retryer.svg)](https://www.npmjs.com/package/axios-retryer)\n  [![npm downloads](https://img.shields.io/npm/dm/axios-retryer.svg)](https://www.npmjs.com/package/axios-retryer)\n  [![codecov](https://codecov.io/github/sampleXbro/axios-retryer/graph/badge.svg?token=BRQB5DJVLK)](https://codecov.io/github/sampleXbro/axios-retryer)\n  [![Known Vulnerabilities](https://snyk.io/test/github/sampleXbro/axios-retryer/badge.svg)](https://snyk.io/test/github/sampleXbro/axios-retryer)\n  ![Build](https://github.com/sampleXbro/axios-retryer/actions/workflows/publish.yml/badge.svg)\n  [![Gzipped Size](https://img.shields.io/bundlephobia/minzip/axios-retryer)](https://bundlephobia.com/package/axios-retryer)\n  [![TypeScript](https://img.shields.io/badge/TypeScript-First-blue)](https://www.typescriptlang.org/)\n  [![License: MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)\n\u003c/div\u003e\n\n---\n\n**[📖 Full Documentation \u0026 Website](https://samplexbro.github.io/axios-retryer)** · [GitHub](https://github.com/sampleXbro/axios-retryer) · [npm](https://www.npmjs.com/package/axios-retryer) · [Changelog](./CHANGELOG.md)\n\n---\n\n## What is axios-retryer?\n\n`axios-retryer` wraps Axios with a production-grade retry manager. It handles the parts that ad hoc interceptors get wrong: concurrent token refresh, orderly request queues, circuit breaking on failing upstreams, response caching, and pluggable observability.\n\n**Key capabilities:**\n\n| | |\n|---|---|\n| 🔄 **Intelligent retries** | Automatic or manual modes, exponential/linear/static backoff, custom strategies |\n| 🚦 **Priority queue** | CRITICAL → LOW priorities, binary-heap scheduling, configurable concurrency |\n| 🔑 **Token refresh** | Queues concurrent 401s, refreshes once, replays all with new token |\n| 🛡️ **Circuit breaker** | Trips on N failures, fast-fails during recovery, sliding-window analysis |\n| 💾 **Response caching** | TTR, exact/prefix/regex invalidation, pluggable storage adapters |\n| 📊 **Metrics \u0026 events** | Live retry counters, timer health, rich lifecycle event hooks |\n| 🌳 **Tree-shakeable plugins** | Each plugin is a separate entry point — unused code stays out of your bundle |\n\n**Requires:** `axios \u003e= 1.7.4`\n\n---\n\n## Installation\n\n```bash\nnpm install axios-retryer\n# yarn add axios-retryer\n# pnpm add axios-retryer\n```\n\n---\n\n## Quick Start\n\n```typescript\nimport { createRetryer } from 'axios-retryer';\nimport { createTokenRefreshPlugin } from 'axios-retryer/plugins/TokenRefreshPlugin';\nimport { createCircuitBreaker } from 'axios-retryer/plugins/CircuitBreakerPlugin';\n\nconst retryer = createRetryer({\n  retries: 3,\n  maxConcurrentRequests: 10,\n});\n\n// Refresh tokens automatically on 401\nretryer.use(createTokenRefreshPlugin(async (axios) =\u003e {\n  const { data } = await axios.post('/auth/refresh');\n  return { token: data.accessToken };\n}));\n\n// Trip circuit open after 5 failures\nretryer.use(createCircuitBreaker({ failureThreshold: 5, openTimeout: 30_000 }));\n\n// Drop-in replacement for axios\nconst { data } = await retryer.axiosInstance.get('/api/users');\n```\n\nTry it: [![Edit on CodeSandbox](https://img.shields.io/badge/Edit_on-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/p/sandbox/axios-retryer-demo-fppdc4)\n\n---\n\n## Plugins\n\nImport only what your app needs. Each plugin is a documented, tree-shakeable entry point:\n\n| Plugin | Import | Purpose |\n|--------|--------|---------|\n| `TokenRefreshPlugin` | `axios-retryer/plugins/TokenRefreshPlugin` | Auth token refresh on 401; optional [no-token opt-out](https://samplexbro.github.io/axios-retryer/docs/plugins/token-refresh#opt-out-of-refresh) |\n| `CircuitBreakerPlugin` | `axios-retryer/plugins/CircuitBreakerPlugin` | Fail-fast on repeated upstream failures |\n| `CachingPlugin` | `axios-retryer/plugins/CachingPlugin` | In-memory response cache with TTR |\n| `ManualRetryPlugin` | `axios-retryer/plugins/ManualRetryPlugin` | Store failures and replay on reconnect |\n| `MetricsPlugin` | `axios-retryer/plugins/MetricsPlugin` | Live retry counters and events |\n| `DebugSanitizationPlugin` | `axios-retryer/plugins/DebugSanitizationPlugin` | Redact secrets from debug logs |\n\n---\n\n## Comparison\n\n| Feature | axios-retryer | axios-retry | retry-axios |\n|---------|--------------|-------------|-------------|\n| Automatic \u0026 Manual Modes | ✅ | ❌ | ❌ |\n| Concurrency Control | ✅ | ❌ | ❌ |\n| Priority Queue | ✅ | ❌ | ❌ |\n| Token Refresh Plugin | ✅ | ❌ | ❌ |\n| Circuit Breaker | ✅ | ❌ | ❌ |\n| Response Caching | ✅ | ❌ | ❌ |\n| Cancellation | ✅ | ❌ | ❌ |\n| Plugin Architecture | ✅ | ❌ | ❌ |\n| TypeScript-First | ✅ | ⚠️ | ⚠️ |\n| Tree-Shakeable | ✅ | ❌ | ❌ |\n\n---\n\n## Performance\n\nCurrent release benchmarks (standard profile, local suite):\n\n- **Healthy-path throughput:** `2,647 req/sec`\n- **Peak burst throughput:** `4,013 req/sec`\n- **Cache hit rate:** `100%`\n- **Test suite:** `67/67` suites · `675/675` tests passing\n\n---\n\n## Documentation\n\nThe full documentation — detailed API reference, all plugin options, guides, examples, and migration notes — lives at:\n\n**[https://samplexbro.github.io/axios-retryer](https://samplexbro.github.io/axios-retryer)**\n\nQuick links:\n- [Installation](https://samplexbro.github.io/axios-retryer/docs/installation)\n- [Configuration reference](https://samplexbro.github.io/axios-retryer/docs/configuration)\n- [Plugins overview](https://samplexbro.github.io/axios-retryer/docs/plugins)\n- [Production setup guide](https://samplexbro.github.io/axios-retryer/guides/production)\n- [Offline support guide](https://samplexbro.github.io/axios-retryer/guides/offline)\n- [Migration 1.x → 2.0](https://samplexbro.github.io/axios-retryer/guides/migration)\n- [API reference](https://samplexbro.github.io/axios-retryer/docs/api-reference)\n- [SECURITY.md](./SECURITY.md) · [KNOWN_ISSUES.md](./KNOWN_ISSUES.md) · [BENCHMARK_RESULTS.md](./BENCHMARK_RESULTS.md)\n\n---\n\n## Contributing\n\nBug reports, feature ideas, and pull requests are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n\n---\n\n\u003cp align=\"center\"\u003e\u003ci\u003eMade with ❤️ by \u003ca href=\"https://github.com/sampleXbro\"\u003esampleX (Serhii Zhabskyi)\u003c/a\u003e\u003c/i\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamplexbro%2Faxios-retryer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamplexbro%2Faxios-retryer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamplexbro%2Faxios-retryer/lists"}