Upstash Ratelimit TS
Developmentupstash-ratelimit-tsUpstash Ratelimit TS is an Agent Skill for development published in the upstash/ratelimit-js repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Lightweight guidance for using the Redis Rate Limit TypeScript SDK, including setup steps, basic usage, and pointers to advanced algorithm, features, pricing, and traffic‑protection docs.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/upstash/ratelimit-js/blob/HEAD/skills/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/upstash-ratelimit-ts, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Rate 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.