ThrottleKit gives you rate limiting you can reason about precisely — from a 169 ns in-processDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AmeyaBorkar/throttlekit/llms.txt
Use this file to discover all available pages before exploring further.
checkSync call to a globally coordinated fleet with a machine-checked overshoot bound. Eight algorithms, six storage backends, and 13 framework adapters share one core and zero runtime dependencies.
Quickstart
Get a working rate limiter in under two minutes with in-memory GCRA.
Installation
Install ThrottleKit and choose the peer dependencies you need.
Algorithms
GCRA, token bucket, fixed/sliding window, leaky bucket, quota, and more.
Storage Backends
In-memory, Redis, Postgres, DynamoDB, Deno KV, and Cloudflare — bit-identical decisions on all.
Framework Adapters
Drop-in middleware for Express, Fastify, Hono, Next.js, tRPC, gRPC, and more.
Distributed Leasing
GALE: TLA⁺-verified fleet-size-independent overshoot bound for high-throughput fleets.
Unified Admission
Compose rate, concurrency, and cost into a single decision — including LLM token budgets.
API Reference
Complete reference for every export, type signature, and option.
Why ThrottleKit
Most rate limiters just count requests. ThrottleKit governs three axes — rate, concurrency, and cost — and gives you a provable bound on each.169 ns Sync API
checkSync returns a full Decision in 169 ns with ~0 allocations. A true synchronous hot path, no await needed.Proven Bit-Identical
The same GCRA runs in JS and Redis Lua. A conformance suite with thousands of generated timelines proves both paths agree exactly.
Zero Runtime Deps
24 tree-shakeable subpath exports. Install only the peer deps your stores and adapters actually need.
Get Started in 30 Seconds
Decision with { allowed, limit, remaining, resetAt, retryAfterMs }. No magic, no surprises.
Create a limiter
Pick a strategy and call
rateLimit(). The default in-memory store requires no infrastructure.Check every request
Call
limiter.checkSync(key) on hot synchronous paths or await limiter.check(key) anywhere else.ThrottleKit requires Node 18+ for the in-memory and fetch-based paths. Redis, Postgres, DynamoDB, Deno KV, and Cloudflare adapters require their respective optional peer dependencies.