upstash-ratelimit-jsот upstash
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-jsRate Limit TS SDK
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.
Больше skills от upstash
context7-cli
by 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-mcp
by upstash
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code…
documentation-lookup
by upstash
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code…
find-docs
by upstash
Retrieve current documentation and code examples for any library using the Context7 CLI.
context7-cli
by 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-lookup
by 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
by 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
by 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",…