Skip to main content
Version: 1.x

RateLimitPluginOptions

RateLimitPluginOptions​

Runtime plugin options consumed by RateLimitPlugin. Configure these via configureRatelimit().

Signature
interface RateLimitPluginOptions {
defaultLimiter?: RateLimitLimiterConfig;
limiters?: Record<string, RateLimitLimiterConfig>;
storage?: RateLimitStorageConfig;
keyPrefix?: string;
keyResolver?: RateLimitKeyResolver;
bypass?: RateLimitBypassOptions;
hooks?: RateLimitHooks;
onRateLimited?: RateLimitResponseHandler;
queue?: RateLimitQueueOptions;
roleLimits?: Record<string, RateLimitLimiterConfig>;
roleLimitStrategy?: RateLimitRoleLimitStrategy;
initializeDefaultStorage?: boolean;
initializeDefaultDriver?: boolean;
}

defaultLimiter​

limiters​

property
Record<string, RateLimitLimiterConfig>

storage​

keyPrefix​

property
string

keyResolver​

bypass​

hooks​

onRateLimited​

queue​

roleLimits​

property
Record<string, RateLimitLimiterConfig>

roleLimitStrategy​

initializeDefaultStorage​

property
boolean
default:
true

Whether to initialize the default in-memory storage if no storage is configured.

initializeDefaultDriver​

property
boolean
default:
true

Alias for initializeDefaultStorage, aligned with other packages.