Skip to content

Home > @opengovsg/rate-limit > CreateRateLimiterOptions

CreateRateLimiterOptions interface ​

Options for creating a rate limiter.

Signature:

typescript
export interface CreateRateLimiterOptions

Properties ​

PropertyModifiersTypeDescription
client?RedisClient | null(Optional) The Redis client backing the limiter's counters. When absent or null, the limiter falls back to in-memory counters, which are per-instance and not shared across replicas.
loggerLoggerLogger receiving configuration warnings and runtime problems such as an unexpected store failure. Per-request logging takes a separate logger on each check.
overrides?RateLimitConfig

(Optional) Configuration merged over the limiter's built-in defaults.

Numeric values are clamped to safe positive integers: non-finite or below-1 values degrade to 1 and fractions are truncated, since the Redis-backed limiter rejects non-integer arguments at runtime.