Streaming Endpoint
Subscribe to flag updates
Section titled “Subscribe to flag updates”Opens a persistent Server-Sent Events (SSE) connection that delivers flag configuration changes in real time.
GET /streamHeaders
Section titled “Headers”Authorization: Bearer <sdk-key>Accept: text/event-streamEvent types
Section titled “Event types”The stream emits two event types:
Sent every 30 seconds to keep the connection alive.
event: pingdata: {"timestamp":"2026-02-16T15:30:00Z"}flag.updated
Section titled “flag.updated”Sent when any flag or segment configuration changes in the environment.
event: flag.updateddata: {"key":"dark-mode","version":4,...}The data payload contains the updated flag configuration in the same FlagDto shape described in the Flags reference.
Errors
Section titled “Errors”401 Unauthorized— Invalid or missing SDK key. The connection is rejected.
SDK implementation notes
Section titled “SDK implementation notes”- Prefer streaming over polling. The SSE connection delivers updates within seconds of a change, while polling introduces latency equal to the poll interval.
- Reconnect on disconnect. If the connection drops, reconnect with exponential backoff. The
EventSourceAPI in browsers handles this automatically. - Merge updates into the local cache. When you receive a
flag.updatedevent, update the corresponding flag in your in-memory store. SDKs should not need to re-fetch the full configuration. - Handle
pingsilently. Ping events exist only to keep the connection open through proxies and load balancers. No action is needed. - Browser limitation: The browser
EventSourceAPI does not support custom headers. If your SDK runs in a browser, pass the SDK key as a query parameter or use the polling strategy instead.
See also
Section titled “See also”- API Overview — authentication, rate limiting, and all endpoints
- Flags Endpoint — the
FlagDtoshape used inflag.updatedpayloads - Events Endpoint — record analytics events
- SDK Overview — official SDKs handle streaming and reconnection automatically