Edge & platform

Add Lume to Vercel in one middleware file

One middleware file, zero added latency, and it works on serverless and edge isolates where the SDK can’t.

No client JS · no added latency · one file

Install

1Install @vercel/functions

Add it with npm i @vercel/functions. Lume uses its waitUntil() helper.

2Add the middleware

Drop a middleware.ts at your project root, or merge it into an existing one.

3Set your ingest token

Add LUME_INGEST_TOKEN as an environment variable and redeploy. No token set? Middleware serves traffic normally and reports nothing.

Good to know

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.

Vercel middleware FAQ

SDK or middleware on Vercel?

Middleware. On Vercel’s serverless / edge isolates the instance can freeze the moment your response returns, dropping the SDK’s batched flush. Middleware + waitUntil is the reliable fire-and-forget path here.

Does it capture response status?

No, middleware runs before your response, so response_status and timing are omitted for this path. Everything else (who, what, where) is captured.

Send your first Vercel middleware event in minutes.

Free plan, one ingest token. See every human, bot, and AI agent, however you install.

Start for free →