Skip to content

AxiosResilienceOptions

Defined in: src/axios.ts:34

Options shared by createResilientFetch and the axios integration.

optional attemptTimeout?: Duration

Defined in: src/fetch.ts:41

Budget per attempt. Default 10 s.

HttpResilienceOptions.attemptTimeout


optional circuitBreaker?: false | Omit<CircuitBreakerOptions<AxiosLikeResponse>, "shouldHandle">

Defined in: src/fetch.ts:47

Circuit breaker options merged over the defaults (50% failures over the last 20 calls, 10 s break). false disables it.

HttpResilienceOptions.circuitBreaker


optional concurrency?: number | ConcurrencyLimiterOptions

Defined in: src/fetch.ts:49

Max attempts in flight per key (bulkhead), e.g. 20 or { permitLimit: 20, queueLimit: 100 }. Default: no limit.

HttpResilienceOptions.concurrency


optional getAdapter?: (adapters, config?) => AxiosLikeAdapter

Defined in: src/axios.ts:39

axios.getAdapter, to resolve adapter names like ['xhr', 'http', 'fetch'] for an axios.create() instance. Default: taken from the default export, or loaded with import('axios') on first use (pass it where that fails, e.g. bundled browser code).

Present on the default export.

any

any

AxiosLikeAdapter


optional maxPipelines?: number

Defined in: src/fetch.ts:56

Max per-key pipelines kept; the least recently used is dropped beyond it. Default 100.

HttpResilienceOptions.maxPipelines


optional name?: string

Defined in: src/fetch.ts:37

Labels telemetry. Per-host pipelines are named <name>/<key>.

HttpResilienceOptions.name


optional onBeforeAttempt?: (config, context) => MaybePromise<void | AxiosLikeConfig>

Defined in: src/axios.ts:41

Called before every attempt; return a replacement config, e.g. with a refreshed auth header.

AxiosLikeConfig

ResilienceContext

MaybePromise<void | AxiosLikeConfig>


optional pipelineKey?: (url) => string

Defined in: src/fetch.ts:54

Which requests share a circuit breaker and limiter. Default url => url.origin: one per host, so a dead host doesn’t open the breaker for the others. () => 'all' shares one.

URL

string

HttpResilienceOptions.pipelineKey


optional retry?: false | Omit<RetryOptions<AxiosLikeResponse>, "shouldHandle">

Defined in: src/fetch.ts:43

Retry options merged over the defaults (3 retries, exponential backoff from 200 ms, full jitter, Retry-After honoured). false disables retries.

HttpResilienceOptions.retry


optional retryOn?: RetryOn<AxiosLikeResponse>

Defined in: src/fetch.ts:45

What to retry. Default: network errors, timeouts and 408/429/500/502/503/504.

HttpResilienceOptions.retryOn


optional retryUnsafeMethods?: boolean

Defined in: src/fetch.ts:58

Retry POST / PATCH without an Idempotency-Key header too. Default false: they could run twice.

HttpResilienceOptions.retryUnsafeMethods


optional timeProvider?: TimeProvider

Defined in: src/fetch.ts:59

HttpResilienceOptions.timeProvider


optional totalTimeout?: Duration

Defined in: src/fetch.ts:39

Budget for the whole call, retries included. Default 30 s.

HttpResilienceOptions.totalTimeout