1. Home
  2. Developers
  3. Streams and webhooks

API guide

Subscribe to live show changes

A confidence monitor needs the current state after a reconnect. An automation needs to know whether it has already processed a delivery. Choose a transport based on which problem you need to solve.

Updated By The runofsho team
ON THIS PAGE
  1. Choose the transport
  2. Open a single-room stream
  3. Receive and verify a webhook
  4. Endpoint reference

Choose the transport

Consumer Transport Why
A read-only stage display Server-sent events (SSE) One HTTP connection receives a snapshot followed by room changes.
A controller that subscribes and sends commands Socket.IO Two-way events and command acknowledgements on namespace /v1, path /v1/socket.io. See the AsyncAPI contract.
A backend that reacts to cue changes Signed webhooks The service delivers an HTTP POST to your HTTPS endpoint and retries unsuccessful deliveries.

Open a single-room stream

Use API, ROOM and a room-authorized read credential from the quickstart. -N disables cURL buffering so each event appears as it arrives. Press Ctrl+C to disconnect.

curl -fsSN "$API/rooms/$ROOM/stream" \
  -H "Authorization: Bearer $RUNOFSHO_KEY" \
  -H 'Accept: text/event-stream'

On first connection, use state.snapshot to render the room. On a reconnect, send the last SSE id in Last-Event-ID. The single-room endpoint replays buffered changes when it can; accept a fresh snapshot when it cannot. If your client detects a gap, read the room state again. Do not treat the multi-room stream as having the same replay contract.

A countdown does not require an event every second. Render from the playback timestamps using a clock synchronized to GET /v1/time. For a public display, use a room-limited output credential, not a team API key. Native browser EventSource cannot set a bearer header; use an authenticated streaming client rather than moving the key into the URL.

Receive and verify a webhook

Webhook setup requires a team admin credential and a plan that includes webhooks. Create a subscription with POST /v1/webhooks, store the returned signing secret immediately, then use the test-delivery endpoint before connecting the receiver to a real workflow.

  1. Read the raw request body before parsing JSON. Read Runofsho-Signature, which contains t (Unix seconds) and v1 (hex digest).
  2. Verify freshness and signature: use a five-minute timestamp tolerance and compare HMAC-SHA256 of t + "." + rawBody, keyed with the webhook secret, using a constant-time comparison. Reject an invalid signature.
  3. Deduplicate by delivery id and durably record or enqueue the work before acknowledging it. Return a 2xx within ten seconds; perform slow work asynchronously.
  4. Compare room versions rather than assuming arrival order. If a delivery fails, inspect the delivery log before requesting a retry.

Endpoint reference

See it run before your next show.

Open the sample room, start a cue, add a minute and send a message. No account needed.

Try a sample room