All skills
upstash avatar

/upstash-redis-js

@35da719
by upstashupstash/skills27 stars
7

Work with the @upstash/redis TypeScript/JavaScript SDK, a serverless HTTP-based Redis client for Next.js, Vercel, Cloudflare Workers, edge runtimes, and Node.js. Use when adding a cache (cache-aside, write-through, TTL and expiration strategies), session storage and user sessions, a key-value store, leaderboards and rankings with sorted sets, counters, distributed locks, queues with lists, streams and consumer groups, sparse index-addressed arrays and ring buffers (ARSET, ARINSERT, ARRING, ARGREP, AROP), embeddings and nearest-neighbour vector search stored inside Redis (VECTOR commands via redis.vector, separate from @upstash/vector), JSON documents, pipelines and MULTI/EXEC transactions, Lua scripting, read replicas, or full-text search, typo-tolerant search, facets, aggregations, and search over Redis stream entries with Upstash Redis Search (different from regular FT.SEARCH; also available for TCP clients via @upstash/search-redis and @upstash/search-ioredis). Also use when migrating from ioredis or node-redis, when a Redis connection is needed from a serverless function without connection pooling, when integrating @upstash/ratelimit, or when the user says Redis cache, KV store, session store, serverless Redis, or Upstash Redis. Supports automatic serialization/deserialization of JavaScript types.

Use this Skill: https://skilld.dev/gh/upstash/skills/upstash-redis-js

This session only. Nothing lands on disk.

advanced-featuresauto-pipeline.md

≈344 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Automatic Pipelining

Overview

Automatic pipelining batches multiple Redis commands into a single HTTP request, reducing round-trip latency for independent operations.

It's enabled by default. Use enableAutoPipelining: false to disable automatic pipelining.

Good For

  • Multiple independent GET/SET operations
  • Batch reads across different keys
  • Reducing latency in high-latency networks
  • Serverless environments with cold starts

Limitations

  • Only works with independent commands (no command depends on another's result)
  • Not beneficial for single commands

Examples

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

const redis = new Redis({
  url: process.env.UPSTASH_REDIS_REST_URL!,
  token: process.env.UPSTASH_REDIS_REST_TOKEN!,
});

// Without auto-pipeline: 3 separate HTTP requests
// With auto-pipeline: 1 HTTP request containing all 3 commands
const [user, posts, comments] = await Promise.all([
  redis.get("user:1"),
  redis.get("posts:1"),
  redis.get("comments:1"),
]);

// Auto-pipeline batches these independent operations
async function fetchUserData(userId: string) {
  const [profile, settings, activity] = await Promise.all([
    redis.hgetall(`user:${userId}:profile`),
    redis.hgetall(`user:${userId}:settings`),
    redis.zrange(`user:${userId}:activity`, 0, 9),
  ]);

  return { profile, settings, activity };
}

Source: SKILL.md on GitHub

1 warning10d3 checks · Risk SAFE
  • Gen Agent Trust Hub10d

    The skill provides a comprehensive set of documentation and code examples for using the Upstash Redis SDK. It covers various data structures, performance optimizations, and search capabilities. No malicious code, obfuscation, or unauthorized data access patterns were detected. The skill uses standard environment variables for secret management and references official Upstash packages.

  • Socket10d

    1 alert: gptSecurity

  • Snyk10d

    Risk: LOW · No issues

Signed by skilld at 35da719. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 days ago.

Activeupdated 2 weeks ago
metadata
{
  "author": "Upstash",
  "homepage": "https://upstash.com"
}

README badge

README badge for upstash/skills/upstash-redis-js