1 min read
Node.js SDK
Integrate Aforo metering into Express, Fastify, and Koa applications.
Updated 2026-07-29Suggest edits
Get the Node.js SDK
The Node.js SDK lives in the public repo github.com/aforoai/SDKs under
aforo-metering-sdks/node.Install & Quickstart#
Add Aforo metering to your Node.js service. Express, Fastify, and Koa middleware plus a manual track() client.
@aforo/metering requires Node 18+ (it uses the built-in fetch). Events POST to https://ingest.aforo.ai/v1/ingest/batch.
Manual Tracking
Express Middleware
The middleware hooks res.on('finish'), so it runs after the response. The default metric name is "<METHOD> <normalized-path>" (e.g. GET /users/:id). Fastify and Koa adapters live under the same @aforo/metering/middleware/* path.
See also