Clov Packages
    Preparing search index...

    Interface RateLimitMacroOptions

    interface RateLimitMacroOptions {
        hook?: "transform" | "derive" | "beforeHandle";
        keyGenerator?: (context: RateLimitKeyContext) => unknown;
        limit: number;
        policy?: string;
        window: number;
    }
    Index
    hook?: "transform" | "derive" | "beforeHandle"

    transform counts first, the key only knows the request. derive | beforeHandle count later, the key can read what earlier hooks added, like a user.

    'transform'
    
    keyGenerator?: (context: RateLimitKeyContext) => unknown
    limit: number
    policy?: string

    Names the quota in the RateLimit fields, and separates its counters from other quotas.

    'default'
    
    window: number