Skip to main content
@upstash/redis is an HTTP/REST based Redis client built on top of Upstash REST API. For more information, refer to the documentation of Upstash redis client (TypeScript & Python). It is the only connectionless (HTTP based) Redis client and designed for:
  • Serverless functions (AWS Lambda)
  • Cloudflare Workers (see the example)
  • Fastly Compute@Edge (see the example)
  • Next.js (see the quickstart), Jamstack
  • Client side web/mobile applications
  • WebAssembly
  • and other environments where HTTP is preferred over TCP.
See the list of APIs supported.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to https://upstash.com/start-redis — free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.

Quick Start

Install

Usage

You can find values to set as UPSTASH_REDIS_REST_URL andUPSTASH_REDIS_REST_TOKEN on the details tab of your database on Upstash Console. See Connect Client page for more information.
If you define UPSTASH_REDIS_REST_URL andUPSTASH_REDIS_REST_TOKEN environment variables, you can load them automatically.