The Limitly SDK provides a simple and powerful way to integrate rate limiting into your application.

Installation

NPM

npm install @limitly/limitly-js

Yarn

yarn add @limitly/limitly-js

PNPM

pnpm add @limitly/limitly-js

Basic Setup

Import and initialize the SDK:
import { Limitly } from '@limitly/limitly-js';

const limitly = new Limitly({
  apiKey: 'your_limitly_api_key'
});

Configuration Options

The SDK accepts the following configuration options:
apiKey
string
required
Your Limitly API key. You can find this in your Limitly dashboard.
baseUrl
string
The base URL for the Limitly API. Defaults to https://api.limitly.dev.
timeout
number
Request timeout in milliseconds. Defaults to 30000 (30 seconds).

Example Configuration

import { Limitly } from '@limitly/limitly-js';

const limitly = new Limitly({
  apiKey: 'lk_1234567890abcdef',
  baseUrl: 'https://api.limitly.dev',
  timeout: 30000
});

Next Steps