upstashupstashOfficialยท1 Agent Skills Included

ratelimit-js

Add serverless rate limiting and abuse protection to any app

Adds Redis-backed rate limiting to serverless functions, edge runtimes, and web apps with a few lines of TypeScript. Supports fixed window, sliding window, and token bucket algorithms plus deny lists and automatic IP abuse blocking. Eliminates the need to build custom throttling logic or manage TCP connections in HTTP-only environments. Includes caching, analytics, and multi-region setups to keep latency low and costs predictable.
npx skills add upstash/ratelimit-js --all -g -y

All Skills in This Repository (1)

Pure Emerald Level Indicators

Frequently Asked Questions

FAQPage Schema
How to install ratelimit-js?โ–ผ

Run `npx skills add upstash/ratelimit-js --all -g -y` in your terminal to install all tools in this suite globally.

How to rate limit serverless functions?โ–ผ

Create a Ratelimit instance with an Upstash Redis database, pick an algorithm like sliding window, and call limit() with a user ID or IP before running your logic.

Which rate limiting algorithm should I use?โ–ผ

Use fixed window for the lowest cost, sliding window for smoother behavior at window boundaries, and token bucket when you want to allow controlled bursts.

Does it work on Cloudflare Workers and Vercel Edge?โ–ผ

Yes. It is HTTP-based with no TCP connections, so it runs natively on Cloudflare Workers, Vercel Edge, Deno, Fastly, and AWS Lambda.

Can it block malicious IPs automatically?โ–ผ

Yes. Enable protection mode to use deny lists and an auto-updating IP blocklist aggregated from over 30 open-source abuse databases.

Related Repositories in Software Engineering

View All in Software Engineeringโ†’