Ratelane.

Quickstart — JavaScript

Add Ratelane to an Express, Fastify, or Hono app in under 5 minutes.

Express

npm install @ratelane/express
import express from 'express';
import { ratelaneMiddleware } from '@ratelane/express';

const app = express();

const ratelane = ratelaneMiddleware({
  apiKey: 'rl_your_api_key',
  serviceName: 'my-api',
});

app.use(ratelane);

// call attach() after all routes are registered
ratelane.attach(app);

Fastify

npm install @ratelane/fastify
import Fastify from 'fastify';
import { ratelaneMiddleware } from '@ratelane/fastify';

const app = Fastify();

await app.register(ratelaneMiddleware, {
  apiKey: 'rl_your_api_key',
  serviceName: 'my-api',
});

Hono

npm install @ratelane/hono
import { Hono } from 'hono';
import { ratelane } from '@ratelane/hono';

const app = new Hono();

app.use(ratelane({
  apiKey: 'rl_your_api_key',
  serviceName: 'my-api',
}));

Next steps

On this page