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
| Prop | Type | Default | Description |
|---|---|---|---|
port | number | 8517 | Broker port. Must match foglamp({ hudPort }) if you changed it. |
url | string | — | Full SSE endpoint (absolute URL or same-origin path like /hud/events). Overrides port / the 127.0.0.1 default — for reaching the broker through a proxy on the page’s own origin (e.g. a hosted demo). |
defaultOpen | boolean | false | Start expanded instead of as the collapsed pill. |
theme | "light" | "dark" | "system" | "system" | Color theme. "system" follows your app’s .dark class / OS. |
redact | boolean | false | Mask prompt / response / tool payloads on screen. Turn on before recording or screen-sharing. |
Server options
Two fields onfoglamp(config) control the broker — see
Configuration for the full table.
| Option | Type | Default | Description |
|---|---|---|---|
hud | boolean | false | Start the local HUD broker. Also enableable via FOGLAMP_HUD=1. |
hudPort | number | 8517 | Port for the in-process SSE broker. Also FOGLAMP_HUD_PORT. |
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:

