Skip to main content
For any job longer than a few seconds, users want to see progress. Reader’s per-job SSE stream gives you exactly the events you need.

CLI progress bar (Node)

Using the cli-progress library:

Browser UI (React)

The API-key-in-browser problem

Browsers can’t set custom headers on EventSource, so you can’t send x-api-key directly from the client. Two options:
  1. Proxy through your backend. Your server opens the SSE stream to Reader with the key, and forwards events to the browser over your own SSE endpoint. Keeps the key server-side.
  2. Use a polyfill. Packages like event-source-polyfill support custom headers, but you’re exposing your API key to the browser, which is usually a bad idea.
The proxy pattern is the right choice for anything public-facing.

Smooth-step trick

If the job finishes faster than the UI can animate, end frames can feel choppy. A common trick: interpolate from current progress to target progress over a short window (200–500ms) rather than snapping instantly.

Next