upstash-redis-js

Implement serverless Redis operations with the Upstash Redis TypeScript SDK.

Updated Jul 30, 2026
One-click install
npx skills add https://github.com/ramizik/okta --skill upstash-redis-js-ramizik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: upstash-redis-js
Source: https://github.com/ramizik/okta/tree/main/.agents/skills/upstash-redis-js
Command: npx skills add https://github.com/ramizik/okta --skill upstash-redis-js-ramizik

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 environments requires an HTTP-based client, and developers often struggle with manual JSON serialization, type loss, and unfamiliar command syntax when using the @upstash/redis SDK. ## Core Features & Use Cases - All Redis Data Structures: Guides for strings, hashes, lists, sets, sorted sets, JSON documents, and streams with automatic serialization of JavaScript types. - Common Patterns: Ready-made implementations for caching, rate limiting, session management, distributed locks, and leaderboards. - Upstash Redis Search: Full-text search, filtering, and aggregations via redis.search, plus TCP adapters for node-redis and ioredis. - Use Case: A developer building a Next.js app on Vercel needs session storage and rate limiting; this Skill provides copy-ready @upstash/redis code with correct TTL, pipelining, and error-handling patterns. ## Quick Start Ask the AI to write a caching layer using @upstash/redis that stores user profiles with a one-hour TTL and automatic serialization.

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. The SDK communicates over HTTP, so no TCP connection management is needed in serverless functions.

How do I migrate from ioredis to @upstash/redis?

Replace the ioredis import with Redis from @upstash/redis, switch host/port config to a REST URL and token, and remove JSON.stringify/parse calls since serialization is automatic. Update command syntax such as zadd(key, { score, member }) and set options like { ex: 3600 }.

Does @upstash/redis automatically serialize JavaScript objects?

Yes, @upstash/redis automatically serializes and deserializes numbers, booleans, objects, and arrays, so redis.set('user', { name: 'Alice' }) returns a parsed object on get. Dates become ISO strings and class instances lose their prototypes.

How do I implement rate limiting with Upstash Redis?

Use a simple INCR with EXPIRE for fixed-window limiting, a sorted set for sliding windows, or the @upstash/ratelimit package for production-grade fixed window, sliding window, and token bucket algorithms.

What is the difference between Upstash Redis Search and regular FT.SEARCH?

Upstash Redis Search is a separate extension accessed via redis.search with a schema builder, supporting querying, filtering, and aggregations over JSON, string, or hash data. Data is upserted with regular Redis commands, and waitIndexing() must be called before querying.

Why does my Upstash Redis query return stale results after writes?

Index updates are batched, so newly written documents may not appear immediately in search results. Call index.waitIndexing() once after your batch of upserts to block until all pending documents are processed.