interface RateLimitStore

Store interface for rate limiting.

Methods

increment(
key: string,
windowMs: number
): Promise<RateLimitResult>

Increment the counter for the given key within its window. Creates the window if it does not exist.

reset(key: string): Promise<void>

Reset the counter for the given key.

Usage

import { type RateLimitStore } from "auth-plugin/src/index.ts";