The HUD does not need an API key. With
hud: true and no apiKey, traces
stream to the overlay but aren’t sent to the backend. If you have a key, both
happen at once.What you need
- A React app (the overlay is a React component). Nothing to install beyond
foglamp. - A server running on Node. The overlay connects to a small localhost event
server that
foglamp({ hud: true })starts inside your process. It does not work on edge or 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:
fog.integration(...) on your
calls, stays the same. The HUD uses the telemetry you already send.
3. Drop in the overlay (client)
Render<FoglampHUD /> once near the root of your client app, for example in
your root layout. Its styles are isolated from yours, and it does nothing
unless the local event server is running, so it’s safe to leave in.
<FoglampHUD /> props
Server options
Two fields onfoglamp(config) control the event server. See
Configuration for the full table.
The client
port and the server hudPort must match. If you run more than
one HUD-enabled process locally, give each its own port and point its
<FoglampHUD port={…} /> at it.Recording a demo
Setredact before you record or screen share. It hides every prompt,
response, and tool payload while keeping the timing, token, and cost view:
Caveats
-
Node runtime, not edge. On Next.js, the route or handler that creates
foglamp({ hud: true })must run on the Node runtime (the default), notexport const runtime = "edge". -
No production cost. The HUD’s server code is loaded lazily and never
enters your edge or browser bundle. The core
foglampentry stays free of React and HTTP code. -
Safe to commit.
<FoglampHUD />does nothing unless the event server is running, so leaving both lines in is harmless. To be explicit, gate it to dev:
.png?fit=max&auto=format&n=1sml0kwCw1BNtiz-&q=85&s=a7c846a133aa3480dc1e03a2da5fec2b)
.png?fit=max&auto=format&n=1sml0kwCw1BNtiz-&q=85&s=6534218552b79980770f11c40aafd6ec)