Skip to content

basalt / fastify/src / RateLimitStore

Interface: RateLimitStore ​

Defined in: http/src/security.ts:20

Backing store for the rate limiter (default in-memory; swap RedisRateLimitStore to share limits across instances). Methods may be sync or async — the limiter awaits them — so an in-process store stays synchronous while a Redis one doesn't.

Methods ​

hit() ​

> hit(key, limit, windowMs): RateLimitResult | Promise<RateLimitResult>

Defined in: http/src/security.ts:21

Parameters ​

key ​

string

limit ​

number

windowMs ​

number

Returns ​

RateLimitResult | Promise<RateLimitResult>


reset() ​

> reset(key): void | Promise<void>

Defined in: http/src/security.ts:22

Parameters ​

key ​

string

Returns ​

void | Promise<void>

Released under the MIT License.