upstash-redis
Skill2 starsChanged 4 months agoMITView on GitHub
Use to add serverless Redis (caching, counters, sessions) or rate limiting over HTTP from edge/serverless runtimes.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- github/awesome-copilottheir own version, first seen Sep 23, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- github/awesome-copilot★ 40ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Use when: you need caching, counters, sessions, queues, or rate limiting in serverless/edge code.
- Distinctive: line 22
Use when: your runtime can't open TCP sockets (edge) — Upstash speaks HTTP/REST.
- Distinctive: line 23
Don't use for: relational data or transactions across tables (use Postgres).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Upstash Redis — Skillship
Serverless, HTTP-based Redis that works from edge/serverless runtimes (Vercel, Cloudflare Workers, Lambda) where raw TCP is restricted. Pay-per-request, scales to zero.
🧭 When to use this skill
- Use when: you need caching, counters, sessions, queues, or rate limiting in serverless/edge code.
- Use when: your runtime can't open TCP sockets (edge) — Upstash speaks HTTP/REST.
- Don't use for: relational data or transactions across tables (use Postgres).
⚡ Quickstart
1. Install
npm install @upstash/redis
# For rate limiting:
npm install @upstash/ratelimit2. Configure env (Console → your DB → REST API)
UPSTASH_REDIS_REST_URL=https://<id>.upstash.io
UPSTASH_REDIS_REST_TOKEN=<token>3. Minimal working example
import { Redis } from "@upstash/redis";
const redis = Redis.fromEnv(); // reads UPSTASH_REDIS_REST_URL/_TOKEN
await redis.set("counter", 0);
await redis.incr("counter");
const value = await redis.get<number>("counter");🧩 Common recipes
Recipe: Cache with TTL
await redis.set("user:42", JSON.stringify(user), { ex: 60 }); // expires in 60s
const cached = await redis.get<string>("user:42");Recipe: Data structures
await redis.zadd("scores", { score: 1, member: "team1" }); // sorted set
await redis.lpush("queue", "job-1"); // list
await redis.hset("people", { name: "joe" }); // hash
await redis.sadd("animals", "cat"); // setRecipe: Rate limiting (sliding window)
import { Ratelimit } from "@upstash/ratelimit";
import { Redis } from "@upstash/redis";
const ratelimit = new Ratelimit({
redis: Redis.fromEnv(),
limiter: Ratelimit.slidingWindow(10, "10 s"), // 10 requests / 10s
analytics: true,
});
const identifier = userId ?? ip; // per-user or per-IP
const { success } = await ratelimit.limit(identifier);
if (!success) return new Response("Too many requests", { status: 429 });Recipe: Edge runtimes (Cloudflare Workers / Vercel Edge)
import { Redis } from "@upstash/redis/cloudflare"; // edge-safe import
// Ensure background analytics/replication finish before the runtime exits:
const { success, pending } = await ratelimit.limit("id");
context.waitUntil(pending); // Workers; on Vercel use waitUntil from the Functions API🚀 Ship to production
UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKENset in the host env (Vercel/Workers secrets).- Rate-limit background work awaited via
waitUntil(pending)in edge/serverless. - Choose a primary region near your writes; add read regions for global reads.
- Set TTLs on cache keys so memory/cost don't grow unbounded.
- Namespace keys (e.g.
prefix) if sharing a DB across apps to avoid collisions.
🔐 Security & secrets
- The REST token grants full DB access — store as a secret, never ship to the browser bundle.
- For client-side reads, create a read-only token; never expose the read/write token publicly.
🐛 Common errors & fixes
| Symptom | Likely cause | Fix |
fromEnv() throws about missing env | Env vars not set / wrong names | Set UPSTASH_REDIS_REST_URL and _TOKEN exactly |
| Rate-limit counts/analytics missing on edge | Runtime exited before background ops | context.waitUntil(pending) |
| Values come back as strings, not objects | Redis stores strings | JSON.stringify on write, parse on read (or use typed get<T>) |
| Higher-than-expected cost | No TTLs / chatty polling | Add TTLs, cache aggressively, batch commands |
💰 Pricing gotchas
- Billed per request (command). MultiRegion replication and analytics add background commands per
limit()call.
📚 Sources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

