About upstash-ratelimit-ts
A skill for using the @upstash/ratelimit TypeScript SDK with Redis to limit incoming operations. It includes guidance on algorithms, SDK methods, costs, and traffic protection.
Key features
- 01Redis-backed rate limiting
- 02Sliding-window limiter example
- 03Rate-limiting algorithm guidance
- 04SDK feature and method references
- 05Traffic protection patterns
Use cases
- 01Limiting operations by user ID
- 02Choosing a rate-limiting algorithm
- 03Reviewing Redis cost implications
- 04Applying abuse-prevention patterns
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ upstash/ ratelimit-js --skill upstash-ratelimit-tsAfter installing, type/upstash-ratelimit-tsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
algorithms.mdfeatures.mdmethods-getting-started.mdpricing-cost.mdtraffic-protection.mdDetails
From the project READMERate 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.
Comments
Markdown supported