Send traffic to Lume from any Node.js server
One server-side call from any Node.js runtime: zero dependencies, batched and retrying by default.
Install
1Install
Add the package with npm i lumetraffic. It has zero dependencies.
2Create an ingest token
Generate one under Settings → Tokens and read it from your environment.
3Track in your handler
Construct one Lume client at startup. In your handler call markStart(req), then trackPageviewOrRESTCall(req, res) once the response finishes. It batches in memory and flushes in the background with retries.
4Deploy
Ship it. Events appear on your dashboard within seconds.
Server-side, in your request handler (Node http / Express)
import { Lume } from 'lumetraffic'
// Create once at startup and reuse it for every request.
const lume = new Lume(process.env.LUME_INGEST_TOKEN!)
// In your request handler:
lume.markStart(req)
res.on('finish', () => lume.trackPageviewOrRESTCall(req, res)) Good to know
- Best when you run a long-lived Node.js server (Express, a self-hosted Next.js Node server, any Node runtime).
- On Vercel serverless / edge isolates the instance can freeze before the batched flush sends. Use the Vercel middleware there instead.
- Crawler verification needs the real visitor IP: set the trustProxy option to match what sits in front of your server (for example 'cloudflare'). It is off by default, so agents are still identified but read as not verifiable. The IP is used transiently for reverse-DNS / IP-range checks and never stored (Lume keeps only an anonymized prefix).
Works with the rest of your stack
Lume is CDN-agnostic and server-side. This is one of several install paths, all feeding the same dashboard. Mix and match across hosts, or move providers without losing your history.
TypeScript SDK FAQ
Does the SDK add latency to my requests?
No. It batches events in memory and flushes them in the background with retries, so your request handler returns immediately. It fails open, so a Lume outage can never break your app.
What if I am not on Node.js?
Use the REST endpoint from any language, or an edge / CDN log path. The SDK is one option, not a requirement: every path feeds the same dashboard.
Send your first TypeScript SDK event in minutes.
Free plan, one ingest token. See every human, bot, and AI agent, however you install.
Start for free →