redis-js

Integrate Upstash Redis SDK for serverless Redis with automatic type preservation.

962|93|Updated Aug 9, 2021
One-click install
npx skills add https://github.com/upstash/redis-js --skill redis-js
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: redis-js
Source: https://github.com/upstash/redis-js/tree/main/skills
Command: npx skills add https://github.com/upstash/redis-js --skill redis-js

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers need an easy, type-safe Redis client for serverless apps that avoids manual JSON serialization and complex TCP connections.

Core Features & Use Cases

  • Automatic serialization/deserialization of JavaScript types across Redis operations.
  • REST-based client designed for serverless environments, edge workers, and browsers.
  • Rich data-structure support including strings, hashes, lists, sets, sorted sets, JSON, streams, and pipelines.
  • Common use cases: caching, session storage, rate limiting, leaderboards, and document-style data storage.

Quick Start

Install the package and initialize Redis from environment variables or a REST URL and token, then begin issuing commands.

Frequently Asked Questions about redis-js

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

FAQPage Schema
How do I use Redis in a serverless environment without managing TCP connections?

Type-safe Redis in TypeScript automatically handles serialization and deserialization of JavaScript types. This preserves your data structures across Redis operations, eliminating the need for manual JSON conversions during caching or session storage.

Does Redis work with TypeScript for storing JSON-like documents without manual serialization?

Type-safe Redis in TypeScript automatically handles serialization and deserialization of JavaScript types. This preserves your data structures across Redis operations, eliminating the need for manual JSON conversions during caching or session storage.

What's the best way to initialize a Redis client for serverless JavaScript?

Initialize a serverless Redis client by loading credentials from environment variables using Redis.fromEnv(), or by directly providing a REST URL and token. Once configured, you can immediately begin issuing commands for caching or rate limiting.

Can I use Redis pipelines for batch operations in edge workers?

Yes, Redis pipelines are supported in edge workers via a REST-based client. Pipelines allow you to batch multiple data structure operations, such as sorted set updates for leaderboards, reducing round trips.

What data structures are supported by a REST-based Redis client in JavaScript?

A REST-based Redis client supports rich data structures including strings, hashes, lists, sets, sorted sets, JSON, and streams. These enable diverse serverless use cases like rate limiting, session storage, and document-style data management.