upstash-redis-js

Implement serverless Redis operations with the Upstash Redis TypeScript SDK.

2|1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/zester4/zilmate --skill upstash-redis-js-zester4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: upstash-redis-js
Source: https://github.com/zester4/zilmate/tree/main/.agents/skills/upstash-redis-js
Command: npx skills add https://github.com/zester4/zilmate --skill upstash-redis-js-zester4

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @upstash/redis, @upstash/ratelimit, @upstash/search-redis, @upstash/search-ioredis, and includes references (resource) components.

What problem does it solve? Working with Redis in serverless and edge environments is difficult because traditional TCP-based clients like ioredis and node-redis require persistent connections and manual JSON serialization. This Skill provides complete guidance for the @upstash/redis SDK, which works over HTTP/REST and automatically serializes JavaScript types. ## Core Features & Use Cases - All Redis Data Structures: Covers strings, hashes, lists, sets, sorted sets, JSON documents, and streams with automatic type serialization, so numbers stay numbers and objects stay objects without JSON.stringify/parse. - Production Patterns: Ready-to-use implementations for caching (cache-aside, write-through), rate limiting, session management, distributed locks, and leaderboards. - Upstash Redis Search: Full-text search, filtering, and aggregations over Redis data using schema-defined indexes, with TCP adapters via @upstash/search-redis and @upstash/search-ioredis. - Performance & Migrations: Auto-pipelining, batching, TTL strategies, error handling with retries, plus step-by-step migration guides from ioredis and node-redis. - Use Case: Build a rate-limited API endpoint on Vercel Edge that caches database queries in Redis, stores user sessions with TTL expiration, and maintains a real-time leaderboard using sorted sets. ## Quick Start Set up an Upstash Redis client using environment variables and store a user session object with a one-hour expiration.

Frequently Asked Questions about upstash-redis-js

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Upstash Redis with TypeScript in a serverless app?

Install @upstash/redis and initialize with Redis.fromEnv() after setting UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN environment variables. The SDK communicates over HTTP/REST, so it works in serverless and edge environments without managing TCP connections.

What is the difference between @upstash/redis and ioredis?

@upstash/redis uses HTTP/REST instead of TCP, making it suitable for serverless functions, and it automatically serializes JavaScript types so numbers and objects round-trip without JSON.stringify. ioredis requires manual serialization and returns all values as strings.

Does Upstash Redis support full-text search?

Yes, Upstash Redis Search provides full-text search, filtering, and aggregations over JSON, string, and hash data using schema-defined indexes. It is accessible via redis.search in @upstash/redis or through @upstash/search-redis and @upstash/search-ioredis adapters for TCP clients.

How do I implement rate limiting with Upstash Redis?

Use INCR with EXPIRE for a simple fixed-window limiter, sorted sets for sliding windows, or Lua scripts for token bucket algorithms. For production, the @upstash/ratelimit package provides fixed window, sliding window, and token bucket limiters built on the SDK.

Why does my Redis data come back as strings instead of numbers?

This happens with TCP clients like ioredis and node-redis, which return all values as strings. The @upstash/redis SDK automatically deserializes values, so numbers, booleans, objects, and arrays retain their JavaScript types without parseInt or JSON.parse.

What are the limitations of automatic serialization in @upstash/redis?

Undefined values, functions, and symbols cannot be serialized, Date objects become ISO strings, class instances lose their prototype methods, and Map or Set contents are lost. Convert these to plain objects or arrays before storing.