OptionalfetchThe underlying fetch implementation to use. Defaults to the global fetch when omitted.
Useful for dependency injection, such as wrapping another HTTP client's own request pipeline
(like wretch middleware's next, or a test mock).
OptionalinitialInitial delay, in milliseconds, before the first retry's exponential backoff. Defaults to DEFAULT_INITIAL_RETRY_DELAY_MS when omitted.
OptionalisPredicate contributing to decision on whether a given network error (thrown by the underlying
fetch call) should be retried.
Defaults to always retrying when omitted. Regardless of this predicate, an AbortError is
never retried, since retrying a deliberate cancellation is never correct.
OptionalisPredicate contributing to decision on whether a given HTTP response status should be retried.
Defaults to defaultIsRetryableStatus (429 or any 5xx) when omitted.
OptionalmaxMaximum allowed response size, in bytes, for fetchWithRetry's text response. Defaults to DEFAULT_MAX_RESPONSE_BYTES when omitted. Not enforced by fetchWithRetryRaw.
OptionalmaxMaximum number of retry attempts for a retryable network error or HTTP response. Defaults to DEFAULT_MAX_RETRIES when omitted.
OptionalmaxMaximum Retry-After delay, in milliseconds, that will be honored. A Retry-After value
exceeding this throws immediately rather than waiting. Defaults to
DEFAULT_MAX_RETRY_AFTER_MS when omitted.
OptionalmaxMaximum delay, in milliseconds, that the exponential backoff (before jitter) can reach. Defaults to DEFAULT_MAX_RETRY_DELAY_MS when omitted.
Options to configure the fetch-with-retry mechanism (fetchWithRetry and fetchWithRetryRaw). All fields are optional and fall back to the module's documented defaults, so existing callers are unaffected by omitting them.