Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
upstash avatar

Redis Js

  • 435 installs
  • 959 repo stars
  • Updated July 31, 2026
  • upstash/redis-js

redis-js is an agent skill that guides the @upstash/redis JavaScript SDK for serverless Redis operations for developers who need caching, sessions, rate limiting, and typed data structures without manual serialization.

About

redis-js is an Upstash agent skill bundled in the upstash/redis-js repository with 23 topic guides across five categories: 7 data-structure files (strings, hashes, lists, sets, sorted sets, streams, JSON), 3 advanced-feature files (auto-pipeline, pipelines/transactions, Lua scripting), 5 pattern files (caching, distributed locks, leaderboards, rate limiting, session management), 6 performance files, and 2 migration guides from ioredis and node-redis. The main SKILL.md (175 lines) indexes automatic JavaScript type serialization, common LLM mistakes like manual JSON stringification, full-text search, and auto-pipelining. Developers reach for redis-js when wiring @upstash/redis into Next.js, serverless functions, or agent backends for session caching, API rate limits, leaderboards, or migrating from ioredis.

  • redis-js
  • AI & Agent Building
  • AI-coding skill

Redis Js by the numbers

  • 435 all-time installs (skills.sh)
  • +11 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #1,876 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/upstash/redis-js --skill redis-js

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs435
repo stars959
Last updatedJuly 31, 2026
Repositoryupstash/redis-js

How do you use Upstash Redis in Node.js apps?

Helps with ai & agent building tasks.

Who is it for?

Node.js and TypeScript developers integrating serverless @upstash/redis for caching, sessions, rate limiting, or leaderboards without managing Redis servers.

Skip if: Self-hosted Redis on VMs requiring ioredis cluster features or projects with zero Redis dependency in the stack.

When should I use this skill?

The developer mentions @upstash/redis, Upstash caching, serverless Redis sessions, rate limiting with Redis, or migrating from ioredis to Upstash.

What you get

Redis client setup, typed cache patterns, rate limiters, session stores, migration notes, and pipeline configurations

  • Redis client configuration
  • Cache/rate-limit patterns
  • Migration checklist from ioredis

By the numbers

  • Bundles 23 topic skill files across 5 categories
  • Covers 7 Redis data-structure guides in skills/data-structures/
  • Main SKILL.md is 175 lines indexing all topic guides

Files

SKILL.mdMarkdownGitHub ↗

Upstash Redis SDK - Complete Skills Guide

This directory contains comprehensive guides for using the @upstash/redis SDK. These skill files are designed to help developers and AI assistants understand and use the SDK effectively.

Installation

npm install @upstash/redis

Quick Start

Basic Initialization

import { Redis } from "@upstash/redis";

// Initialize with explicit credentials
const redis = new Redis({
  url: "UPSTASH_REDIS_REST_URL",
  token: "UPSTASH_REDIS_REST_TOKEN",
});

// Or initialize from environment variables
const redis = Redis.fromEnv();

Environment Variables

Set these in your .env file:

UPSTASH_REDIS_REST_URL=https://your-redis.upstash.io
UPSTASH_REDIS_REST_TOKEN=your-token-here

Skill Files Overview

Data Structures (skills/data-structures/)

Redis data types with auto-serialization examples:

  • strings.md - GET, SET, INCR, DECR, APPEND with automatic type handling
  • hashes.md - HSET, HGET, HMGET with object serialization
  • lists.md - LPUSH, RPUSH, LRANGE with array handling
  • sets.md - SADD, SMEMBERS, set operations
  • sorted-sets.md - ZADD, ZRANGE, ZRANK, leaderboard patterns
  • json.md - JSON.SET, JSON.GET, JSONPath queries for nested objects
  • streams.md - XADD, XREAD, XGROUP, consumer groups

Advanced Features (skills/advanced-features/)

Complex operations and optimizations:

  • auto-pipeline.md - Automatic request batching, performance optimization
  • pipeline-and-transactions.md - Manual pipelines, MULTI/EXEC, WATCH for atomic operations
  • scripting.md - Lua scripts, EVAL, EVALSHA for server-side logic

Patterns (skills/patterns/)

Common use cases and architectural patterns:

  • caching.md - Cache-aside, write-through, TTL strategies
  • rate-limiting.md - Integration with @upstash/ratelimit package
  • session-management.md - Session storage and user state management
  • distributed-locks.md - Lock implementations, deadlock prevention
  • leaderboard.md - Sorted set leaderboards, real-time rankings

Performance (skills/performance/)

Optimization techniques and best practices:

  • batching-operations.md - MGET, MSET, batch operations
  • pipeline-optimization.md - When to use pipelines, performance tips
  • ttl-expiration.md - Key expiration strategies, memory management
  • data-serialization.md - Deep dive into auto serialization, custom serializers, edge cases
  • error-handling.md - Error types, retry strategies, timeout handling, debugging tips
  • redis-replicas.md - Global database setup, read replicas, read-your-writes consistency

Search (skills/search/)

Full-text search, filtering, and aggregation extension for Redis:

  • overview.md - Schema definition, field types, pitfalls, package overview
  • commands/querying.md - Query and count with filters, pagination, sorting, highlighting
  • commands/aggregating.md - Metric aggregations ($avg, $sum, $stats), bucket aggregations ($terms, $range, $histogram, $facet)
  • commands/index-management.md - Create, describe, drop indexes, waitIndexing
  • commands/aliases.md - Index aliases for zero-downtime reindexing
  • adapters.md - Using search with node-redis and ioredis via @upstash/search-redis and @upstash/search-ioredis

Migrations (skills/migrations/)

Migration guides from other libraries:

  • from-ioredis.md - Migration from ioredis, key differences, serialization changes
  • from-redis-node.md - Migration from node-redis, API differences

Common Mistakes (Especially for LLMs)

❌ Mistake 1: Treating Everything as Strings

// ❌ WRONG - Don't do this with @upstash/redis
await redis.set("count", "42"); // Stored as string "42"
const count = await redis.get("count");
const incremented = parseInt(count) + 1; // Manual parsing needed

// ✅ CORRECT - Let the SDK handle it
await redis.set("count", 42); // Stored as number
const count = await redis.get("count");
const incremented = count + 1; // Just use it

❌ Mistake 2: Manual JSON Serialization

// ❌ WRONG - Unnecessary with @upstash/redis
await redis.set("user", JSON.stringify({ name: "Alice" }));
const user = JSON.parse(await redis.get("user"));

// ✅ CORRECT - Automatic handling
await redis.set("user", { name: "Alice" });
const user = await redis.get("user");

Quick Command Reference

// Strings
await redis.set("key", "value");
await redis.get("key");
await redis.incr("counter");
await redis.decr("counter");

// Hashes
await redis.hset("user:1", { name: "Alice", age: 30 });
await redis.hget("user:1", "name");
await redis.hgetall("user:1");

// Lists
await redis.lpush("tasks", "task1", "task2");
await redis.rpush("tasks", "task3");
await redis.lrange("tasks", 0, -1);

// Sets
await redis.sadd("tags", "javascript", "redis");
await redis.smembers("tags");

// Sorted Sets
await redis.zadd("leaderboard", { score: 100, member: "player1" });
await redis.zrange("leaderboard", 0, -1);

// JSON
await redis.json.set("user:1", "$", { name: "Alice", address: { city: "NYC" } });
await redis.json.get("user:1");

// Expiration
await redis.setex("session", 3600, { userId: "123" });
await redis.expire("key", 60);
await redis.ttl("key");

Best Practices

1. Use environment variables for credentials, never hardcode 2. Leverage auto-serialization - pass native JavaScript types 3. Use TypeScript types for better type safety 4. Set appropriate TTLs to manage memory 5. Use pipelines for multiple operations 6. Namespace your keys (e.g., user:123, session:abc)

Resources

Getting Help

For detailed information on specific topics, refer to the individual skill files in the skills/ directory. Each file contains comprehensive examples, use cases, and best practices for its topic.

Related skills

How it compares

Pick redis-js over generic Redis skills when the stack uses Upstash serverless HTTP Redis rather than self-hosted TCP Redis clusters.

FAQ

What does the redis-js skill cover?

redis-js covers the @upstash/redis JavaScript/TypeScript SDK for caching, session storage, rate limiting, leaderboards, full-text search, and all Redis data structures. It includes 23 topic guides with automatic serialization and migration paths from ioredis.

Does redis-js document common Redis SDK mistakes?

redis-js documents common LLM mistakes such as treating all values as strings and manually JSON-serializing objects. The @upstash/redis SDK preserves JavaScript types automatically, and the skill shows correct patterns per data structure.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.