# @rc-ex/retry

> Retry extension for ringcentral-extensible project

Latest version **1.4.1** (published 2026-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rc-ex/retry
pnpm add @rc-ex/retry
yarn add @rc-ex/retry
bun add @rc-ex/retry
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2026-05-19 |
| First published | 2020-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Tyler Liu |
| Maintainers | tylerlong |

## Links

- npm: https://www.npmjs.com/package/@rc-ex/retry
- Repository: https://github.com/ringcentral/ringcentral-extensible
- Homepage: https://github.com/ringcentral/ringcentral-extensible/tree/master/packages/extensions/retry
- Issues: https://github.com/ringcentral/ringcentral-extensible/issues
- npm.io page: https://npm.io/package/@rc-ex/retry

## Dependencies (1)

- [wait-for-async](https://npm.io/package/wait-for-async.md) ^0.8.0

## Recent versions

- 1.4.1 (latest) — 2026-05-19
- 1.4.0 — 2026-04-07
- 1.3.16 — 2026-04-07
- 1.3.15 — 2026-01-08
- 1.3.14 — 2025-03-12
- 1.3.13 — 2025-02-04
- 1.3.12 — 2025-02-04
- 1.3.11 — 2025-02-04
- 1.3.10 — 2025-02-03
- 1.3.9 — 2025-02-02
- 1.3.7 — 2025-02-02
- 1.3.6 — 2025-02-02
- 1.3.5 — 2025-01-31
- 1.3.4 — 2025-01-28
- 1.3.2 — 2025-01-28
- … 95 more at https://npm.io/package/@rc-ex/retry/versions

## README

# Retry Extension

Retry API calls upon `RestException`

## Install

```
pnpm add @rc-ex/retry
```

## Usage

```ts
import RingCentral from '@rc-ex/core';
import RetryExtension from '@rc-ex/retry';

const rc = new RingCentral(...);
const retryExtension = new RetryExtension(retryOptions);
await rc.installExtension(retryExtension);
```

## Options

### RetryOptions

`RetryExtension` constructor accepts optional `RetryOptions` as parameter:

```ts
type RetryOptions = {
  shouldRetry?: ShouldRetry;
  retryInterval?: RetryInterval;
};
```

### ShouldRetry

`ShouldRetry` defines condition about should retry or abort:

```ts
type ShouldRetry = (
  restException: RestException,
  retriesAttempted: number,
) => boolean;
```

By default, `ShouldRetry` returns true when `restException.response.status` is
429 or 503 and `retriesAttempted` is smaller than 3:

```ts
((restException, retriesAttempted) => {
  return retriesAttempted < 3 &&
    [429, 503].includes(restException.response.status);
});
```

### RetryInterval

`RetryInterval` defines how long should wait before try:

```ts
type RetryInterval = (
  restException: RestException,
  retriesAttempted: number,
) => number;
```

By default `RetryInterval` is 60 seconds with exponential back off:

```ts
((restException, retriesAttempted) => {
  return 60 * 1000 * Math.pow(2, retriesAttempted); // exponential back off
});
```

---
_Source: https://npm.io/package/@rc-ex/retry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
