The HUD reuses your existing instrumentation — it does not need an API key.
With
hud: true and no apiKey, traces stream to the overlay but aren’t sent
to ingest. Already have a key? Both happen at once.Requirements
- A React app (the overlay is a React component). No other dependencies —
the pill↔panel morph runs on a tiny vendored spring, so there’s nothing to
install beyond
foglamp. - A server on a Node runtime — the overlay connects to a localhost
Server-Sent-Events broker that
foglamp({ hud: true })starts in-process. Not edge, not serverless (see Caveats).
1. Install
If you already use Foglamp, you have everything. Otherwise:2. Turn the HUD on (server)
Passhud: true where you create the collector. This starts the in-process
localhost broker.
fog.integration(...) on your
generateText / streamText calls — is unchanged; the HUD rides the telemetry
you already emit.
3. Drop in the overlay (client)
Render<FoglampHUD /> once near the root of your client app — e.g. your root
layout or App. It mounts into a Shadow DOM (its styles can’t collide with
yours) and is inert unless the local broker is running, so it’s safe to leave in.
<FoglampHUD /> props
Server options
Two fields onfoglamp(config) control the broker — see
Configuration for the full table.
The client
port and the server hudPort must agree. If you run more than one
HUD-enabled process locally (e.g. a dashboard plus a worker), give each its own
port and point its <FoglampHUD port={…} /> at it.Recording a demo
Setredact before you record or screen-share — it masks every prompt,
completion, and tool payload while keeping the timing, token, and cost view
intact.
Caveats
-
Node runtime, not edge. The broker is a localhost
node:httpSSE server. On Next.js, the route/handler that constructsfoglamp({ hud: true })must run on the Node runtime (the default) — notexport const runtime = "edge". -
No production cost. The HUD’s server code (broker + live pricing) is
code-split and lazy-loaded; it never enters your edge/browser bundle. The core
foglampentry stays React-free and HTTP-free. -
Safe to commit.
<FoglampHUD />does nothing unless a broker is running, so leaving both lines in is harmless — but gatehud: trueto dev if you want to be explicit:

