OptionalbaseBase backoff (ms) used when the response has no Retry-After
header. Doubles each attempt and adds random jitter up to
ResilientHttpClientOptions.jitterMs. Defaults to 500.
OptionalfetchInjected fetch for tests. Defaults to the global fetch. Typed as
the minimum signature the client actually calls so that simple test
mocks (which don't implement preconnect) satisfy the contract.
OptionaljitterRandom jitter (ms) added on top of the exponential backoff. Helps
avoid synchronized retries from concurrent in-flight calls
hammering the same throttled endpoint. Defaults to 250.
OptionalmaxMaximum number of additional attempts after the initial request.
The total attempt count is maxRetries + 1. Defaults to 3 (i.e.
up to 4 attempts).
OptionalonOptional hook fired before each backoff sleep. Receives the status, URL, body sample, and the chosen sleep duration. Use it to emit a structured log line — the resilient client itself is silent.
OptionalsleepInjected sleep function for tests. Defaults to setTimeout-based
sleep. Receives milliseconds.
Tunables for createResilientHttpClient. All optional.