RateLimitStore
Defined in: packages/auth/src/ratelimit/rate-limit-store.ts:15
Methods
Section titled “Methods”increment()
Section titled “increment()”increment(
key,windowSeconds,units?):Promise<RateLimitIncrementResult>
Defined in: packages/auth/src/ratelimit/rate-limit-store.ts:25
Atomically increment the counter at key by units (a positive integer,
defaulting to 1). The window TTL must be applied on the first increment of
a window (when the counter transitions from absent to units) and left
untouched thereafter, giving a fixed window anchored at the first request.
Multi-unit increments let the limiter meter by actual work: a request that fans out into N downstream operations charges N units in one atomic step.
Parameters
Section titled “Parameters”string
windowSeconds
Section titled “windowSeconds”number
units?
Section titled “units?”number
Returns
Section titled “Returns”Promise<RateLimitIncrementResult>