upstash-ratelimit-js

Lightweight guidance for using the Upstash Redis RateLimit TypeScript/JavaScript SDK, including setup steps, basic usage, and pointers to advanced algorithm,…

npx skills add https://github.com/upstash/skills --skill upstash-ratelimit-js

Rate Limit TS SDK

Bundled docs and source

Before writing or debugging SDK code, check node_modules/@upstash/ratelimit/docs/ for bundled docs and node_modules/@upstash/ratelimit/src/ for readable TypeScript source. Read and search the relevant files when present; otherwise use the references in this skill.

Quick Start

  • Install the SDK and connect to Redis.
  • Create a rate limiter and apply it to incoming operations.

Example:

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

const redis = new Redis({ url: "<url>", token: "<token>" });
const limiter = new Ratelimit({ redis, limiter: Ratelimit.slidingWindow(5, "10s") });

const { success } = await limiter.limit("user-id");
if (!success) {
  // throttled
}

Other Skill Files

  • algorithms.md: Describes all available rate‑limiting algorithms and how they behave.
  • pricing-cost.md: Explains pricing, Redis cost implications, and operational considerations.
  • features.md: Lists SDK features such as prefixes, custom keys, and behavioral options.
  • methods-getting-started.md: Full method reference for the SDK's API and getting started guide.
  • traffic-protection.md: Guidance on applying rate limiting for traffic shaping, abuse prevention, and protection patterns.

More skills from upstash

context7-cli
upstash
Use the ctx7 CLI to fetch library documentation, manage AI coding skills, and configure Context7 MCP. Activate when the user mentions "ctx7" or "context7",…
context7-docs
upstash
Fetch up-to-date documentation and code examples for any library, framework, SDK, CLI tool, or cloud service. Use whenever the user asks about a specific…
context7-docs-lookup
upstash
Use Context7 to fetch up-to-date library documentation. Activates when the user asks about libraries, frameworks, API references, or needs code examples —…
context7-mcp
upstash
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code…
ctx7-cli
upstash
Use the ctx7 CLI to fetch library documentation, manage AI coding skills, and configure Context7 MCP. Activate when the user mentions "ctx7" or "context7",…
docs
upstash
Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework. Use when writing code that depends on…
documentation-lookup
upstash
Fetch current library documentation and code examples instead of relying on training data. Resolves library names to Context7 documentation IDs, then queries for setup, configuration, and API reference information Supports major frameworks and libraries: React, Vue, Svelte, Next.js, Express, Prisma, Supabase, Tailwind, and others Activates automatically for setup questions, code generation requests, and framework-specific inquiries Returns version-aware documentation and official code...
find-docs
upstash
Retrieve current documentation and code examples for any library using the Context7 CLI.