All skills
upstash avatar

upstash-ratelimit-ts

upstash/ratelimit-js

Rate limiting library for serverless runtimes

2,036 48 Updated 2 months ago First seen 4 years agosteady
npx -y skilld add gh:upstash/ratelimit-js -s upstash-ratelimit-ts

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.

Source: SKILL.md on GitHub

Indexed from github.com/upstash/ratelimit-js on branch main.

SKILL.md
skills/SKILL.md

No curators have added this skill yet. Be the first to include it in a collection.