Skip to main content

Documentation Index

Fetch the complete documentation index at: https://houseofdragon-079a8546.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Requirements

Install

npm install @throttlr/sdk

Initialize

Create a single instance of RateLimiter and reuse it across your application. Do not create a new instance per request.
import { RateLimiter } from "@throttlr/sdk";

export const limiter = new RateLimiter({
  apiKey: process.env.THROTTLR_API_KEY!,
  baseUrl: "https://api.throttlr.dev/sdk",
});

Constructor Options

OptionTypeRequiredDescription
apiKeystringYour project’s API key from the dashboard
baseUrlstringOverride the API base URL (defaults to production)
Never hardcode your API key in source code. Use environment variables.

Environment Setup

Add your key to .env:
THROTTLR_API_KEY=sk_live_your_key_here
And load it in your app:
import dotenv from "dotenv";
dotenv.config();