Upstash Ratelimit
A strong pick. 6th of 10 web security libraries.
Upstash Ratelimit is an HTTP-based rate limiter for serverless and edge runtimes. It stores its counters in Upstash Redis. It is the usual choice for rate limiting a Next.js or Vercel app, and its use grew fast this year. It only limits request rates, and it ties you to a paid hosted Redis.
Best for: Teams on Vercel, Cloudflare Workers or other serverless platforms who need shared rate limits without managing a Redis connection.
Scores
Overall7.0
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
For serverless and edge apps, especially on Vercel, it is the simplest well-maintained way to share rate limits, and its use is growing fast. It does only one part of the category's job and ties you to a paid Upstash database. On long-running servers, express-rate-limit or rate-limiter-flexible are more flexible picks.
- npm downloads ratio: About 11.6 times growth in a year
- toolpick.dev/blog/arcjet-vs-upstash-ratelimit-2026: Recommended when you need only rate limiting at low cost
- peers rate-limiter-flexible: The peer supports many stores and is more active
GPT-6.2 Sol: 7.5, likely 6.3 to 8.6
Upstash Ratelimit is a strong pick for new edge and serverless apps that need shared counters and already use Upstash Redis. Express-rate-limit is a more direct fit for conventional Express apps, and rate-limiter-flexible gives Node teams more backend choices. The hosted dependency, deployment-specific latency, and still modest indexed adoption widen the range.
- upstash.com/docs/redis/sdks/ratelimit-ts/gettingstarted: Shows the supported edge setup and distributed limiting features.
- express-rate-limit.mintlify.app/reference/stores: Documents the built-in memory store and external stores for Express.
- github.com/animir/node-rate-limiter-flexible: Documents the peer's wider range of storage backends.
- dependents, npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo: Shows rapid install growth alongside a modest indexed footprint.
Needed by many4.2
How many developers need a tool for this job?
Claude Opus 5.5: 4.0, likely 3.0 to 5.0
Rate limiting is a common need, but this library serves one slice of it: serverless and edge apps that accept Upstash Redis. Long-running Node servers usually pick express-rate-limit or rate-limiter-flexible. The category also covers headers and HTML cleaning, which this library does not do.
- github description: Described as a rate limiting library for serverless runtimes
- upstash.com/docs/oss/sdks/ts/ratelimit/overview: Aimed at serverless functions, Vercel Edge, Cloudflare Workers and Next.js
- project note: Needs Upstash Redis, a paid service
GPT-6.2 Sol: 4.4, likely 3.2 to 5.6
Many public APIs need request throttling, and the HTTP transport makes this library usable across several frameworks and runtimes. Its strongest fit is the smaller group that needs shared counters and is willing to use hosted Upstash Redis. The framework survey gives context for the size of the web backend audience, while the share that needs this setup is uncertain.
- 2025.stateofjs.com/en-US/libraries/back-end-frameworks: Shows the breadth of JavaScript backend framework use.
- upstash.com/docs/redis/sdks/ratelimit-ts/gettingstarted: Documents the Upstash Redis setup and edge runtime support.
- upstash.com/pricing/redis: Lists the capped free tier and paid service plans.
Helps a lot7.5
How well does it do the job for those who need it?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
It has several algorithms, multi-region support, an in-memory cache for blocked IDs, deny lists, analytics and good types, all behind a simple API. The documentation is good, and many examples make it easy for AI agents to write correct code. Its limits are the lock-in to Upstash Redis and the extra care that edge runtimes need for pending promises and multi-region accuracy.
- upstash.com/docs/redis/sdks/ratelimit-ts/features: Timeouts, multi-region tradeoffs and handling of pending promises
- toolpick.dev/blog/arcjet-vs-upstash-ratelimit-2026: Simple API, but it needs Redis and does only rate limiting
- github.com/upstash/ratelimit-js/releases: v2.2.0 fixed token-bucket and cache edge cases
- npm hasTypes: Ships TypeScript types
GPT-6.2 Sol: 7.9, likely 6.8 to 9.0
Version 2.2.1 gives edge apps a small typed API, several algorithms, and useful controls for caching, request weights, and dynamic limits. Bundled docs give coding agents version-specific references, though runtime-specific background work still needs care. Redis latency varies by deployment, and the approximate sliding window limits confidence for teams that need strict quotas.
- upstash.com/docs/redis/sdks/ratelimit-ts/algorithms: Explains supported algorithms and the sliding-window approximation.
- upstash.com/docs/redis/sdks/ratelimit-ts/gettingstarted: Documents runtime-specific background work and configuration.
- github.com/upstash/ratelimit-js/releases/tag/v2.2.1: Adds source and documentation to the published package.
- reddit.com/r/nextjs/comments/1slwcjv/question_on_rate_limiting_and_ddos_protection_for: Developers discuss latency and cost in a Vercel deployment.
Holds up over time7.1
Will it still be a good choice in two years?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
A company whose business depends on the library maintains it. There were six releases in the last year, the latest in November 2026, and few issues are open. Activity is moderate, with 24 commits a year against 120 or more for the rate-limiting peers, and 12 pull requests are open. The library's future is tied to Upstash as a company.
- github commitsLastYear: 24 commits and 6 releases in the last year
- github latestRelease: v2.2.1 on 2026-11-12
- github openIssues/openPullRequests: 4 open issues, 12 open pull requests
- github.com/upstash/ratelimit-js/releases: Regular releases, with canaries before stable ones
GPT-6.2 Sol: 7.2, likely 5.9 to 8.4
Upstash maintains the library alongside its Redis service, and four npm versions in the past year show continued maintenance. The release history shows two people publishing GitHub releases, though a request for ioredis support has stayed open since 2024. The two-year outlook depends on one vendor's service and priorities.
- github commitsLastYear, npm versionsLastYear: Records 24 commits and four npm versions in the past year.
- github.com/upstash/ratelimit-js/releases: Shows recent stable releases by two people.
- github.com/upstash/ratelimit-js: Lists Upstash professional support for the library.
- github.com/upstash/ratelimit-js/issues/115: Tracks the longstanding request for native ioredis support.
Used widely5.2
How many use it, and is that growing?
Claude Opus 5.5: 5.5, likely 4.5 to 6.5
Downloads are 13.5M per 4 weeks, up from 1.17M a year ago. That is a ratio of about 11.6, far above the 4.1 median. It has 2,053 dependent repositories, below rate-limiter-flexible's 3,010 and express-rate-limit's 27,591. Templates and automated installs inflate the download count. Direct choices are likely in the tens of thousands and growing.
- npm downloadsLast4Weeks: 13.5M now against 1.17M a year ago
- dependents repos: 2,053 repos and 55 packages
- github stars: 2,052 stars
- peers express-rate-limit: The peer has 27,591 dependent repos
GPT-6.2 Sol: 4.8, likely 3.5 to 6.1
Four-week downloads rose 11.6× year over year, well above the catalog median of 4.1×. The partial index found 2,053 dependent repositories and 55 dependent packages, behind both rate-limiting peers on repository count. Automated installs and indirect use make it hard to tell how much of the download growth came from new projects choosing it.
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, medianDownloadsRatio: 13.5 million downloads versus 1.17 million a year earlier.
- dependents, peers dependentRepos: Upstash has 2,053 indexed repos, versus 3,010 for rate-limiter-flexible and 27,591 for express-rate-limit.
Vouched for6.2
Who stands behind it being good?
Claude Opus 5.5: 6.0, likely 4.5 to 7.0
Vercel offers official templates built on it, and Next.js guides and third-party roundups recommend it for serverless rate limiting. Independent write-ups call it a good library, but there are no benchmarks or survey data. Most material comes from Upstash or from tutorials.
- vercel.com/templates/next.js/ratelimit-with-upstash-redis: Official Vercel template uses it
- dev.to/ethanleetech/4-best-rate-limiting-solutions-for-nextjs-apps-2024-3ljj: Third-party roundup says the Next.js docs recommend it
- dev.to/jtorchia/rate-limiting-in-nextjs-what-to-protect-before-picking-a-library-2blc: Independent author calls it a good library for serverless
- hackerNews/bluesky: No HN stories and no Bluesky posts
GPT-6.2 Sol: 6.3, likely 4.9 to 7.5
Dub uses the library in its application, and Vercel documents where its token bucket fits alongside the platform's own rate limiting. Developer discussions support its serverless fit and raise the cost of checking Redis on the request path. Evidence for retention and comparative SDK performance remains thin.
- github.com/dubinc/dub/blob/main/apps/web/lib/upstash/ratelimit.ts: Shows Dub using the sliding-window limiter in application code.
- vercel.com/i/rate-limiting-algorithms: Compares Upstash token-bucket limiting with Vercel's native options.
- reddit.com/r/node/comments/1s98jl7/rate_limiting_per_endpoint_when_everything_goes: Developers compare its serverless fit with the rate-limiting peers.
- reddit.com/r/nextjs/comments/1slwcjv/question_on_rate_limiting_and_ddos_protection_for: Developers discuss the Redis round trip and its cost.
Safe7.5
How safe is it to depend on?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
There are no known advisories. It has one runtime dependency and an MIT licence, and it publishes through npm OIDC. There is no OpenSSF Scorecard to check, and v2.1.0 added SDK telemetry. Every request depends on an outside paid service, so you need to set a timeout and choose what happens when the service is unreachable.
- advisories total: 0 advisories
- npm dependencies: 1 dependency, MIT licence
- scorecard: No Scorecard data
- github.com/upstash/ratelimit-js/releases: OIDC release and telemetry added in v2.1.0
GPT-6.2 Sol: 7.5, likely 6.1 to 8.7
The package uses the permissive MIT license and has one direct dependency plus the Upstash Redis peer dependency. The release workflow moved to npm trusted publishing with provenance, and OSV lists zero advisories for the package. The default timeout lets traffic through when a check takes too long. Missing OpenSSF Scorecard data limits confidence in the broader repository controls.
- raw.githubusercontent.com/upstash/ratelimit-js/v2.2.1/package.json: Confirms MIT and the direct and peer dependencies.
- github.com/upstash/ratelimit-js/pull/149: Documents the move to npm OIDC and provenance.
- upstash.com/docs/redis/sdks/ratelimit-ts/features: Documents the default timeout and fail-open behavior.
- advisories total, scorecard: Zero OSV advisories and no collected OpenSSF Scorecard.
Good
- It works over HTTP, so it runs in edge runtimes and serverless functions where TCP Redis clients fail.
- It offers fixed-window, sliding-window and token-bucket algorithms, plus multi-region, caching, deny lists and dynamic limits.
- It has one runtime dependency, full TypeScript types, and Vercel and Next.js templates to copy.
- Downloads grew about 11.6 times in a year, well above the 4.1 median.
Bad
- It needs an Upstash Redis database, which is a paid hosted service, so you are tied to one vendor.
- It only limits request rates. Headers, CSRF, bot detection and HTML cleaning need other tools.
- On edge runtimes you must handle the pending promise yourself, or multi-region sync and analytics can break.
- Recent versions added SDK telemetry and changed token-bucket behaviour, so check upgrades.
The numbers
- npm downloads, 4 weeks
- 14M ×12 in a year
- GitHub stars
- 2.1k
- Commits, 12 months
- 24
- npm version
- 2.2.1 Nov 2026
- Versions, 12 months
- 4
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- None
- Licence
- MIT
It needs Upstash Redis, a paid service.
Read on 21 November 2026 from GitHub (upstash/ratelimit-js), npm (@upstash/ratelimit), OSV and the OpenSSF Scorecard.
Web security libraries
- 8.7DOMPurify
- 8.2Helmet
- 7.9express-rate-limit
- 7.6cors
- 7.4rate-limiter-flexible
- 7.0Upstash Ratelimit
- 6.8sanitize-html
- 6.1csrf-csrf
- 5.7Arcjet
- 5.0js-xss