Skip to content

RetryOptions

How a failed request is retried.

Properties

Property Type Description
backoffFactor? number The multiplier. Used by 'exponential' only. Default 2
backoffMaxDelayMs? number Longest wait allowed, in ms. A Retry-After wait uses maxRetryAfterMs instead. Default 30000
backoffStrategy? BackoffStrategy How the wait grows. For a delay d and factor f: constant d, d, d
initialDelayMs? number How long to wait before the first retry, in ms. Later waits grow from this. Default 500
maxRetries? number How many extra tries after the first. 0 turns retrying off. Default 2
maxRetryAfterMs? number Longest Retry-After wait allowed, in ms. Unlimited by default. Default Infinity
respectRetryAfter? boolean Let a Retry-After header decide the wait instead. Default true
retryableStatusCodes? number[] Which statuses are worth retrying. Default [408, 429, 500, 502, 503, 504]
retryDelay? number Base delay between retries in milliseconds. Deprecated Use RetryOptions.initialDelayMs. Still honoured when initialDelayMs is not supplied; scheduled for removal in a future minor release.
retryMethods? HttpMethod[] Which methods are worth retrying. Defaults to the ones RFC 9110 says are safe to repeat. Default ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS']
retryNetworkErrors? boolean Retry when the request never reached the server. Default true
useExponentialBackoff? boolean Whether to use exponential backoff. Deprecated Use RetryOptions.backoffStrategy — true maps to 'exponential' and false to 'constant'. Still honoured when backoffStrategy is not supplied; scheduled for removal in a future minor release.