Skip to content

Home > @opengovsg/rate-limit > createGlobalRateLimiter

createGlobalRateLimiter() function ​

Create a pre-authentication rate limiter keyed purely by client IP.

Mount this before authentication flows that rely on querying critical infrastructure.

Defaults to 100 points per second with no burst. Override via CreateRateLimiterOptions.overrides. Pass skipKeyNormalization: true to use each IP string verbatim as the store key.

Signature:

typescript
createGlobalRateLimiter: (options: CreateGlobalRateLimiterOptions) => GlobalRateLimiter

Parameters ​

ParameterTypeDescription
optionsCreateGlobalRateLimiterOptions

Returns:

GlobalRateLimiter