@nowarajs/elysia-ratelimit
    Preparing search index...

    Interface RateLimitOptions

    Options to configure the rate limit plugin.

    const options: RateLimitOptions = {
    store: redisInstance, // Your Redis instance
    limit: 100, // Allow 100 requests
    window: 60, // Per 60 seconds
    };
    interface RateLimitOptions {
        limit: number;
        store?: Redis | ":memory:";
        window: number;
    }
    Index

    Properties

    Properties

    limit: number

    Maximum number of requests allowed in the time window.

    This defines how many requests a client can make within the specified time window before rate limiting is applied.

    store?: Redis | ":memory:"

    Storage backend for rate limit data.

    • If not specified, defaults to in-memory storage
    • Use ':memory:' to explicitly specify in-memory storage
    • Provide a Redis instance for persistent distributed storage
    window: number

    Time window in seconds during which the request limit applies.

    This defines the duration of the rate limiting window. For example, a window of 60 with a limit of 100 allows 100 requests per minute per client.