Ratelane.

JavaScript SDK

Full configuration reference for the Ratelane JavaScript SDKs.

Packages

PackageFramework
@ratelane/expressExpress
@ratelane/fastifyFastify

Config options

Both packages share the same config shape:

OptionTypeRequiredDescription
apiKeystring✅Your Ratelane API key from the dashboard
collectorUrlstring✅https://api.ratelane.dev for production
instanceVersionstring❌Your app version, shown in instance detail

Express — attach()

For Express, you must call attach() after all routes are registered. This is how Ratelane discovers your routes:

app.use(ratelane);

// register all your routes here...

ratelane.attach(app); // call last

Fastify — plugin registration

For Fastify, register the plugin before starting the server:

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

Route discovery

Routes are collected automatically on startup. HEAD routes are filtered from discovery but still enforced normally.

Device info

Every telemetry poll includes:

{
  sdk_version: string,      // auto from package.json
  runtime: 'node',
  runtime_version: string,  // e.g. "20.11.0"
  framework: string,        // e.g. "express"
  instance_version: string  // from your config
}

On this page