Products:
Redis
Stack:
Next.js
Use Case:
Ratelimit
Languages:
TypeScript
Platforms:
Vercel
Publisher:

Ratelimiting with Vercel KV

This example showcases how you can add serverless ratelimiting using @upstash/ratelimit and Vercel KV.

Demo

ratelimit-with-vercel-kv.vercel.app

Getting Started

Prerequisites

All you need is a Vercel account and Vercel KV database

Quickstart

  1. Clone the repo

    git clone https://github.com/upstash/examples.git
    cd examples/examples
    
  2. Install packages

    pnpm install
    
  3. Enter your secrets in .env

    KV_URL=""
    KV_REST_API_URL=""
    KV_REST_API_TOKEN=""
    KV_REST_API_READ_ONLY_TOKEN=""
    
    
  4. Run the app

    pnpm dev
    
  5. Open http://localhost:3000 with your browser to see the result.

Learn More

To learn more about Upstash and its services, check out the following resources: