Skip to content

Class: RetryTransport ​

An HttpTransport decorator that retries transient failures with exponential backoff and full jitter. It retries on connection errors, HTTP 429/502/503/504, and the "please wait" rate-limit body, honoring a Retry-After header when present. It does not retry 500 (ambiguous) or other 4xx (client errors). The retry set is method-agnostic: the SDK's mutations are idempotent (follow/like) or carry an idempotence token (comment), and every retryable signal means the request was rejected rather than applied.

Implements ​

Constructors ​

Constructor ​

ts
new RetryTransport(inner, options?): RetryTransport;

Parameters ​

ParameterType
innerHttpTransport
options?RetryOptions

Returns ​

RetryTransport

Methods ​

request() ​

ts
request(req): Promise<HttpResponse>;

Sends the request, retrying transient failures with backoff.

Parameters ​

ParameterType
reqHttpRequest

Returns ​

Promise<HttpResponse>

Implementation of ​

HttpTransport.request

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.