prorm API Reference
    Preparing search index...

    Interface RateLimiterOptions

    interface RateLimiterOptions {
        user?: RateLimitConfig;
        anonymous?: RateLimitConfig;
        ip?: RateLimitConfig;
        endpoint?: RateLimitConfig;
        role?: Record<string, RateLimitConfig>;
        action?: RateLimitAction;
        throttleDelay?: number;
        logEvents?: boolean;
        onLimitExceeded?: (info: RateLimitInfo) => void;
        storeInDb?: boolean;
        rateLimitModelName?: string;
    }
    Index

    Rate limit for authenticated users

    anonymous?: RateLimitConfig

    Rate limit for anonymous users (by IP)

    Rate limit per IP address

    endpoint?: RateLimitConfig

    Rate limit per endpoint

    role?: Record<string, RateLimitConfig>

    Rate limit per role

    Action when limit is exceeded: 'block' (return error) or 'throttle' (add delay)

    throttleDelay?: number

    Throttle delay in ms when action is 'throttle'

    logEvents?: boolean

    Enable logging of rate limit events

    onLimitExceeded?: (info: RateLimitInfo) => void

    Callback when rate limit is exceeded

    storeInDb?: boolean

    Store rate limit data in database (requires table)

    rateLimitModelName?: string

    Model name for storing rate limit data