upstash-ratelimit-js

โดย upstash

คำแนะนำแบบกระชับสำหรับการใช้ Upstash Redis RateLimit TypeScript/JavaScript SDK รวมถึงขั้นตอนการตั้งค่า การใช้งานพื้นฐาน และคำแนะนำเกี่ยวกับอัลกอริทึมขั้นสูง…

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

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.

Skills เพิ่มเติมจาก upstash

context7-docs
upstash
ดึงเอกสารประกอบและตัวอย่างโค้ดที่ทันสมัยสำหรับไลบรารี เฟรมเวิร์ก SDK เครื่องมือ CLI หรือบริการคลาวด์ใดๆ ใช้เมื่อผู้ใช้ถามเกี่ยวกับเฉพาะ…
official
context7-mcp
upstash
ทักษะนี้ควรใช้เมื่อผู้ใช้ถามเกี่ยวกับไลบรารี เฟรมเวิร์ก เอกสารอ้างอิง API หรือต้องการตัวอย่างโค้ด เปิดใช้งานสำหรับคำถามเกี่ยวกับการตั้งค่า โค้ด…
official
ctx7-cli
upstash
ใช้ CLI ctx7 เพื่อดึงเอกสารไลบรารี จัดการทักษะการเขียนโค้ด AI และกำหนดค่า Context7 MCP เปิดใช้งานเมื่อผู้ใช้พูดถึง "ctx7" หรือ "context7"...
official
docs
upstash
ดึงข้อมูลและค้นหาเอกสารประกอบและตัวอย่างโค้ดที่ทันสมัยจาก Context7 สำหรับไลบรารีหรือเฟรมเวิร์กการเขียนโปรแกรมใดๆ ใช้เมื่อเขียนโค้ดที่ขึ้นอยู่กับ…
official
documentation-lookup
upstash
ดึงเอกสารไลบรารีและตัวอย่างโค้ดล่าสุด แทนการพึ่งพาข้อมูลฝึกฝน แก้ไขชื่อไลบรารีเป็นรหัสเอกสาร Context7 จากนั้นค้นหาข้อมูลการตั้งค่า การกำหนดค่า และเอกสารอ้างอิง API รองรับเฟรมเวิร์กและไลบรารีหลัก: React, Vue, Svelte, Next.js, Express, Prisma, Supabase, Tailwind และอื่นๆ เปิดใช้งานโดยอัตโนมัติสำหรับคำถามเกี่ยวกับการตั้งค่า คำขอสร้างโค้ด และคำถามเฉพาะเฟรมเวิร์ก ส่งคืนเอกสารที่คำนึงถึงเวอร์ชันและโค้ดอย่างเป็นทางการ...
official
find-docs
upstash
ดึงเอกสารและตัวอย่างโค้ดล่าสุดสำหรับไลบรารีใดๆ โดยใช้ Context7 CLI
official
redis-js
upstash
ทำงานกับ Upstash Redis JavaScript/TypeScript SDK สำหรับการดำเนินการ Redis แบบไร้เซิร์ฟเวอร์ ใช้สำหรับแคช การจัดเก็บเซสชัน การจำกัดอัตรา ลีดเดอร์บอร์ด การค้นหาข้อความแบบเต็ม…
official
upstash-search-js
upstash
จุดเริ่มต้นสำหรับทักษะด้านเอกสารที่ครอบคลุมการเริ่มต้นใช้งาน Upstash Search อย่างรวดเร็ว แนวคิดหลัก และการใช้งาน TypeScript SDK ใช้เมื่อผู้ใช้ถามถึงวิธีการเริ่มต้น…
official