Ratelane.

Quickstart — JavaScript

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

Express

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

const app = express();

app.use(express.json());

const ratelane = ratelaneMiddleware({
  apiKey: 'sk_live_your_api_key',
  collectorUrl: 'https://api.ratelane.dev',
  instanceVersion: '1.0.0', // optional: your app version
});

app.use(ratelane);

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

app.listen(3000);

Fastify

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

const app = Fastify();

await app.register(ratelaneMiddleware, {
  apiKey: 'sk_live_your_api_key',
  collectorUrl: 'https://api.ratelane.dev',
  instanceVersion: '1.0.0', // optional: your app version
});

await app.listen({ port: 3000 });

Your instance will appear in the Ratelane dashboard within seconds. Routes are discovered automatically on startup.

Next steps

On this page