# Flyrell/axios-auth-refresh

Library that helps you implement automatic refresh of authorization via axios interceptors. You can easily intercept the original request when it fails, refresh the authorization and continue with the original request, without user even noticing.

Repository: https://github.com/Flyrell/axios-auth-refresh
Canonical: https://ross.abutalabs.com/products/axios-auth-refresh
Language: TypeScript
License: MIT
License Family: permissive
Topics: axios, axios-plugin, interceptor, stalled-requests, token, authentication, middleware, http-interceptor, typescript
Last push: 2026-05-08T06:36:27+00:00

## Health v2 (maintenance only)
Score: 82/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 81, release rhythm 74, longevity 100
- inputs: {"age_days": 2841, "days_push": 117, "days_rel": 173, "gap_med": 0.0, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1144, forks 93 (observed 2026-08-28T04:03:45.135183+00:00)

## What it is
A TypeScript library that adds automatic authorization token refresh to Axios via interceptors. When a request fails with an authorization error, it runs your refresh logic, stalls concurrent requests, and replays them with the new token transparently.

## Use cases
- automatically refresh expired access tokens in axios
- retry failed 401 requests after token refresh
- queue requests while auth token is being refreshed
- handle silent session renewal in a frontend app
- attach axios interceptor for refresh token flow

## When to choose
- your app uses axios and needs seamless token refresh
- you want concurrent requests to wait for a single refresh call
- you need a small, typed, MIT-licensed auth helper

## When to avoid
- you don't use axios as your HTTP client
- you need full OAuth/session management rather than just refresh interception
- you use fetch or another non-axios request library

## Facets
- artifact type: library
- maturity: active
- function: auth, middleware, http-client
- domain: web-development, security, apis
- platform: browser, cross-platform
- tags: axios, token-refresh, interceptor, typescript, http, nodejs

## Member repositories
- Flyrell/axios-auth-refresh (main) score 82

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:45.135183+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:34:41.595606+00:00, confidence not recorded.
  - readme: https://github.com/Flyrell/axios-auth-refresh (fetched 2026-08-28T04:03:45.135183+00:00, sha ba8acd35a9bf)
  - registry_npm: https://registry.npmjs.org/axios-auth-refresh (fetched 2026-08-29T12:39:56.523348+00:00, sha e1d50fb1621b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
