Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / clients / createRateLimitMiddleware

Function: createRateLimitMiddleware()

createRateLimitMiddleware(config): Middleware

Defined in: packages/b2c-tooling-sdk/src/clients/middleware.ts:254

Creates rate limiting middleware for openapi-fetch clients.

This middleware inspects responses for rate-limit status codes (by default 429 Too Many Requests), uses the Retry-After header when present to determine a delay, and retries the request up to a configurable limit.

The middleware is generic and can be used by MRT and other clients. It does not currently read CLI configuration directly; callers should pass configuration via the factory function.

Parameters

config

RateLimitMiddlewareConfig = {}

Returns

Middleware

Released under the Apache-2.0 License.