Skip to main content
express-quota-limiter is an Express.js middleware for enforcing long-window quotas — think 500 emails per month or 1,000 API calls per day — rather than per-second rate limits. It ships with Redis and in-memory storage drivers, supports custom quota keys, request weighting, dynamic per-tenant limits, and fire-and-forget callbacks for usage tracking.

Quick Start

Install the package and add your first quota middleware in under five minutes.

Core Concepts

Learn how quota keys, drivers, and weighting work together.

Guides

Step-by-step walkthroughs for multi-tenant apps, callbacks, testing, and custom drivers.

API Reference

Full reference for createQuotaLimiter, drivers, types, and response headers.

How it works

1

Install

Add express-quota-limiter to your project with npm or yarn.
2

Choose a driver

Use RedisDriver for production or MemoryDriver for local development and tests.
3

Create middleware

Call createQuotaLimiter with your storage driver, quota key generator, and limit.
4

Attach to routes

Pass the returned middleware to any Express route or router.
Unlike rate limiters that enforce requests-per-second windows, express-quota-limiter is designed for long-window quotas — daily, weekly, or monthly usage caps.