Stream Watcher Changes
Opens a Server-Sent Events stream that delivers a watcher’s change events as
its scheduled polls detect them. The stream emits exactly these events:
connected, change, heartbeat, reconnect, and stopped.
Delivery is decoupled from the watcher’s pollInterval: the watcher polls
upstream on its own schedule, while the stream drains whatever it has found
every 20 seconds, sending heartbeat on a tick with nothing new. A single
stream lasts at most 5 minutes and then sends reconnect; open a new one to
continue. stopped means the watcher was paused or deleted.
Every event carries an SSE id — a resume cursor. Reconnect with the standard
Last-Event-ID header, or with since on a first connect where the client
cannot set headers.
Tier: Business+
SSE Events
The stream emits exactly five event types:heartbeat is a connection keep-alive on the stream’s own short drain cadence. It is
not tied to the watcher’s pollInterval and does not mean an upstream poll just
completed.
The stream requires Business or Internal tier, and returns 400 if the watcher is
paused.
Resuming
Everychange, heartbeat, and reconnect event carries an SSE id: a cursor into
the watcher’s change buffer, which retains the last 50 detected changes. Send that
cursor back and the server resumes from it rather than from the current tip.
Last-Event-ID: <id>header — what browserEventSourceand the Borough SDK replay automatically on reconnect. Wins if both are supplied.?since=<id>query parameter — for a first connect from a client that cannot set request headers.
connected event carries no id.
See the streaming guide
for worked examples and the retention caveats.Authorizations
Polar.sh license key. Format: BOROUGH-<uuid>
Path Parameters
Watcher ID (UUID)
Query Parameters
Resume cursor — the SSE id of the last event you processed. Changes recorded after it are replayed, bounded by how many the watcher retains. Ignored when Last-Event-ID is present, which takes precedence. A connect with neither starts at the current tip instead of replaying.
x >= 0Response
Server-Sent Events stream
The response is of type string.