Home > @opengovsg/rate-limit > GlobalRateLimiter
GlobalRateLimiter interface
A rate limiter keyed purely by client IP, for use before authentication. Obtain one via createGlobalRateLimiter().
Signature:
export interface GlobalRateLimiterMethods
| Method | Description |
|---|---|
| check(args) | Consume from the allowance of By default, IPv4 addresses are keyed per address and IPv6 addresses by their /64 prefix, since a subscriber typically holds an entire /64 and could otherwise mint a fresh bucket per request. IPv4-mapped IPv6 addresses are keyed by the embedded IPv4 address. An unparseable IP falls into a shared Pass Pass a request-scoped Throws RateLimitExceededError when the allowance is exhausted. |