Real-Time Streaming
Section titled “Real-Time Streaming”Establish a persistent WebSocket connection to receive notification updates as they are produced. The transport is a single bidirectional WebSocket — clients receive JSON-formatted notification messages and heartbeat frames over the open socket. Use this endpoint when a display needs live updates without polling the notifications REST API.
For the broader notification model, see the Notification Server overview.
Connect to the notification stream
Section titled “Connect to the notification stream”GET /api/v1/notifications/stream
Opens a WebSocket connection for real-time notification updates. Subscribe to one or more displays via the required displays query parameter, or pass "all" to receive notifications from every display. Once the handshake completes, the server pushes notification messages — and periodic heartbeat frames — directly over the open socket.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
displays | query | string | Yes | Comma-separated display IDs to subscribe to (e.g., 0,:1,2), or "all" to receive notifications from every display. |
This endpoint accepts no request body.
Responses
Section titled “Responses”{ "description": "Switching Protocols - WebSocket connection established"}The WebSocket handshake completed successfully. Subsequent frames received on the open socket are JSON notification messages and heartbeats.
{ "statusCode": 400, "error": "Bad Request", "message": "Invalid query parameter: 'displays' is required"}{ "error": "Connection limit exceeded", "type": "error"}The server refused to open a new WebSocket because the per-client connection limit has been reached. Close any existing streams before reconnecting.
SDK usage
Section titled “SDK usage”// Subscribe to specific displaysconst stream = client.notifications.connectStream({ displays: "0,:1,2" });
stream.on("message", (frame) => { // frame is a JSON notification or heartbeat message console.log(frame);});// Subscribe to every displayconst all = client.notifications.connectStream({ displays: "all" });