Skip to main content
All types described on this page are exported directly from express-quota-limiter. You can import them by name alongside the runtime exports — no separate @types/ package is needed.

QuotaStorage

The interface every storage driver must implement. Pass an object satisfying this interface to the storage option of createQuotaLimiter.

QuotaResult

The value returned by QuotaStorage.decrement.

LimitResolver

The accepted type for the limit option in QuotaOptions. You can provide a static number or a (possibly async) function that receives the request and returns the limit for that specific call.
Static example:
Dynamic example — per-tenant plan:

QuotaOptions

The configuration object passed to createQuotaLimiter.

QuotaCheckedContext

Passed to the onQuotaChecked callback after every quota check, whether the request was allowed or blocked.

QuotaExceededContext

Passed to the onQuotaExceeded callback only when a request is blocked due to quota exhaustion. Note that remaining and success are omitted — they are always 0 and false respectively when this callback fires.

RedisDriverOptions

Options accepted by the RedisDriver constructor.

MemoryDriverOptions

Options accepted by the MemoryDriver constructor.