@upstash/redis

HTTP/REST-based Redis client built for serverless and edge runtimes

SDK
npm
v1.38.2
965stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
71/100Good
Development Activity64
Maintenance72
Community52
Maturity56
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture82
Code Quality84
Innovation80
Learning Curve78

@upstash/redis is the official TypeScript client for Upstash’s HTTP REST API in front of Redis. Instead of holding a persistent TCP connection like traditional Redis drivers, every command is sent as a single HTTPS request, which makes it a natural fit for AWS Lambda, Cloudflare Workers, Fastly Compute@Edge, Vercel Functions, and other short-lived or connectionless execution environments.

The client covers the full Redis command surface — strings, hashes, lists, sets, sorted sets, geo, bitmaps, RedisJSON, and Redis Functions/scripts — with typed method signatures, plus pipelining, transactions, retries, and optional read-your-writes consistency.

What You Get

  • A Redis client class with 200+ typed command methods covering strings, hashes, lists, sets, sorted sets, streams, geo, bitmaps, and RedisJSON
  • Platform-specific builds for Node.js, Cloudflare Workers, and Fastly Compute@Edge exported from dedicated subpaths
  • Pipeline and multi/transaction APIs plus an automatic request-batching proxy for reducing round trips
  • Built-in retry-with-backoff, base64 response decoding, and optional read-your-writes consistency tracking

Common Use Cases

  • Caching database query results and API responses in serverless functions
  • Rate limiting and request throttling at the edge
  • Session storage and feature flagging for jamstack and single-page applications
  • Lightweight pub/sub and streaming via server-sent events for real-time features

Under The Hood

Architecture — The library is centered on a Redis class (pkg/redis.ts) that composes roughly 200 typed *Command classes (e.g. GetCommand, HSetCommand, ZAddCommand under pkg/commands/) with a single HttpClient (pkg/http.ts) that implements the Requester interface. Each command serializes its Redis arguments into a JSON body and calls requester.request(), which POSTs to the Upstash REST endpoint, retries on network failure with exponential backoff, and decodes base64-encoded results back into native JS types (pkg/http.ts, decode()/base64decode()). Pipeline and Script/ScriptRo (pkg/pipeline.ts, pkg/script.ts) reuse the same command classes but batch them into one HTTP call, and auto-pipeline.ts wraps the Redis instance in a Proxy that auto-batches same-tick calls, distinguishing read/write commands via a READ_COMMANDS set for read-your-writes correctness. Three thin platform entry points (platforms/nodejs.ts, cloudflare.ts, fastly.ts) construct the same Redis core with runtime-appropriate fetch/agent options.

Tech Stack — Pure TypeScript, built with tsup into CJS/ESM/.d.ts bundles (tsup.config.ts), tested with Bun’s built-in test runner (bun test). The published package has exactly one runtime dependency, uncrypto (for cross-runtime crypto), keeping the client lightweight and tree-shakeable. The repo is a pnpm workspace (pnpm-workspace.yaml) housing @upstash/redis alongside sibling search-redis/search-ioredis packages, released via a Changesets-driven GitHub Actions pipeline with separate stable and canary publish flows.

Code Quality — Very high test density: 213 *.test.ts files sit directly alongside their corresponding pkg/commands/*.ts implementation files (e.g. redis.test.ts, pipeline.test.ts, auto-pipeline.test.ts, read-your-writes.test.ts), plus dedicated integration tests for Redis Functions. Error handling is centralized in three purpose-built classes (UpstashError, UrlError, UpstashJSONParseError in pkg/error.ts) that wrap raw REST failures with actionable messages, and the HTTP layer’s retry, backoff, and base64-decoding paths are exercised directly in http.test.ts. Naming is consistent throughout — every command file exports a single <Name>Command class extending a shared Command base.

API Design — The public API deliberately mirrors familiar Redis client conventions (redis.get(), redis.hset(), redis.zadd()), so anyone who has used ioredis or redis-py can be productive immediately; getting started requires only new Redis({ url, token }) with no connection lifecycle to manage. Extensive inline TSDoc comments on option types (RetryConfig, HttpClientConfig) and 26 runnable examples spanning Next.js, Cloudflare Workers, AWS Lambda, Azure Functions, and more keep the barrier to entry low despite the large command surface.

Used by 13 apps in this directory

TypeScript
49%
MPL 2.0

Artillery

Devops · Developer Tools

9,054

Cloud-scale load testing and functional testing for APIs, WebSockets, gRPC, and headless browsers, distributed across AWS Lambda or Fargate with zero infrastructure to manage.

View details
89
Repo Health
73
Technical
68
Dependency
Built with
TypeScript49%
JavaScript48%
Updated 5 days ago
TypeScript
96%
Other

Cal.diy

Scheduling

47,796

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
93
Repo Health
86
Technical
66
Dependency
Built with
TypeScript96%
Updated 1 weeks ago
TypeScript
100%
Other

Dub

Marketing · Analytics

24,521

The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.

View details
81
Repo Health
78
Technical
65
Dependency
Built with
TypeScript100%
Updated today
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,379

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,294

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
88
Repo Health
73
Technical
66
Dependency
Built with
TypeScript99%
Updated today
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

14,770

All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.

View details
56
Repo Health
78
Technical
72
Dependency
Built with
TypeScript96%
Updated 2 months ago
TypeScript
80%
AGPL 3.0

OpenStatus

Monitoring · Devops

8,993

Open-source status pages and uptime monitoring with global synthetic checks, monitoring-as-code, and AI agent integration via MCP.

View details
76
Repo Health
82
Technical
72
Dependency
Built with
TypeScript80%
MDX16%
Updated yesterday
TypeScript
76%
MIT

OpenCode

AI Code Assistants

198,979

A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.

View details
89
Repo Health
76
Technical
68
Dependency
Built with
TypeScript76%
MDX21%
Updated today
TypeScript
99%
Other

Papermark

Digital Signiture · File Storage

8,952

Open-source DocSend alternative with page-by-page analytics, secure data rooms, and custom domains for document sharing.

View details
86
Repo Health
63
Technical
68
Dependency
Built with
TypeScript99%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search