Paused on breakpoint
Rate limiting,
inspected.
TypeScript-first SDK. Redis-backed. Zero config. Free forever.
api/route.ts
1
2
3
4
5
6
7
8
9
10
11
// app/api/route.tsexport async function GET(request: Request) {const userId = request.headers.get('x-user-id') ?? 'anonymous';const result = await client.checkRateLimit(userId);if (!result.allowed) {return Response.json({ error: 'Too many requests' }, { status: 429 });}return Response.json({ success: true });}
VARIABLES
result.allowedtrueboolean
result.remaining99number
result.limit100number
result.resetAtDateDate
Watch
Everything you need to implement rate limiting without the complexity.
BREAKPOINTS / FEATURES
TypeScript-First
Fully typed, catch errors at compile time.
Free Forever
No API keys, no payments, no usage caps.
Zero Config
Install, import, start rate limiting in seconds.
Multiple Algorithms
Token bucket, sliding window, fixed window, leaky bucket.
Bring Your Own Redis
Full tenant isolation with your own Redis or hosted.
Dynamic Config
Set limits per request without redeployment.
PostHog Analytics
Optional PostHog integration for rate limit events.
Console
Get started in seconds. Copy the snippets below.
1
Install
Get the Limitly SDK
1
npm install limitly-sdk
2
Create client
Initialize with your Redis (optional)
1
2
3
4
5
6
import { createClient } from 'limitly-sdk';const client = createClient({redisUrl: process.env.REDIS_URL ?? 'redis://localhost:6379',serviceId: 'my-app',});
3
Use in your API
Protect endpoints with one call
1
2
3
4
5
6
7
8
9
export async function GET(request: Request) {const userId = request.headers.get('x-user-id') ?? 'anonymous';const result = await client.checkRateLimit(userId);if (!result.allowed) {return Response.json({ error: 'Too many requests' }, { status: 429 });}return Response.json({ success: true });}
Network
Compare Limitly to other rate limiting solutions.
| Feature | express-rate-limit | Upstash | Arcjet | Unkey | BESTLimitly |
|---|---|---|---|---|---|
| TypeScript Support | (first) | ||||
| Type Safety | (full) | ||||
| IntelliSense | |||||
| Free | (no limits) | ||||
| Distributed | (Redis) | ||||
| Token Bucket | |||||
| Dynamic Limits | |||||
| Rate Limit Headers | |||||
| Graceful Degradation | |||||
| Self-Hosted Option |
Call stack
Frequently asked questions.
FRAMES