# upstash/ratelimit-js

Rate limiting library for serverless runtimes

Repository: https://github.com/upstash/ratelimit-js
Canonical: https://ross.abutalabs.com/products/ratelimit-js
Homepage: https://ratelimit-with-upstash.vercel.app/
Language: TypeScript
License: MIT
License Family: permissive
Topics: rate-limiting, redis, serverless, upstash, upstash-ratelimit, upstash-sdk
Last push: 2026-08-24T20:14:35+00:00

## Health v2 (maintenance only)
Score: 83/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 53, longevity 100
- inputs: {"age_days": 1596, "days_push": 9, "days_rel": 233, "gap_med": 70, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2044, forks 50 (observed 2026-08-28T04:06:08.787941+00:00)

## What it is
A TypeScript rate limiting library backed by Upstash Redis that works over HTTP, making it suitable for serverless and edge runtimes. It provides sliding window, fixed window, token bucket, and other limiting algorithms with optional analytics.

## Use cases
- rate limit api requests in serverless functions
- add rate limiting to next.js app
- limit requests per ip in cloudflare workers
- sliding window rate limiter with redis
- protect expensive endpoints from abuse
- rate limiting on vercel edge functions

## When to choose
- you need connectionless HTTP-based rate limiting in serverless or edge environments
- you already use Upstash Redis
- you want built-in analytics and multiple window algorithms

## When to avoid
- you want rate limiting without an external Redis dependency
- you need TCP-based Redis with a self-hosted instance and low latency
- you are not on a JavaScript/TypeScript runtime

## Facets
- artifact type: library
- maturity: stable
- function: rate-limiting, caching, middleware
- domain: backend, web-development, apis
- platform: serverless, wasm, cloud
- tags: redis, upstash, serverless, edge-runtime, http-based, sliding-window, fixed-window, typescript-sdk, nodejs, deno, typescript

## Member repositories
- upstash/ratelimit-js (main) score 83

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:08.787941+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:58:05.161694+00:00, confidence not recorded.
  - readme: https://github.com/upstash/ratelimit-js (fetched 2026-08-28T04:06:08.787941+00:00, sha 1410e9033582)
  - homepage: https://ratelimit-with-upstash.vercel.app/ (fetched 2026-08-29T10:38:17.994709+00:00, sha 187d252fc127)
- Data as of 2026-08-30T08:39:29.467469+00:00.
