Skip to main content

Install the Package

Install the @convex-dev/rate-limiter package using your preferred package manager:
npm install @convex-dev/rate-limiter

Configure Convex

Create a convex.config.ts file in your app’s convex/ folder and register the rate limiter component by calling use:
convex/convex.config.ts
import { defineApp } from "convex/server";
import rateLimiter from "@convex-dev/rate-limiter/convex.config.js";

const app = defineApp();
app.use(rateLimiter);

export default app;
The convex.config.ts file is where you configure all Convex components. If you already have this file, simply add the app.use(rateLimiter) line.

Version Requirements

The rate limiter component has the following peer dependencies:
  • Convex: ^1.24.8 or higher (required)
  • React: ^18.2.0 or ^19.0.0 (optional, only needed if using the React hook)
Make sure your Convex version is at least 1.24.8. Earlier versions are not compatible with this component.

Verify Installation

After installation, run your Convex development server:
npx convex dev
The component will be automatically compiled and available for use in your Convex functions.

Next Steps

Quickstart

Follow the quickstart guide to define and use your first rate limit

Build docs developers (and LLMs) love