Stream Alerts service
The Stream Alerts service provides real-time event delivery via WebSocket. When a creator receives a donation, subscription, or other event on Tuniform, the event is instantly pushed to all connected WebSocket clients for that creator. This allows:- OBS overlays to display live alerts during streams
- External platforms (e.g., SparkGG) to subscribe to real-time creator activity
- Custom tools to react to donations, subscriptions, and other events as they happen
There is also a fallback polling mechanism: overlay clients can periodically poll the Tuniform server to fetch events from the database. This ensures alerts are never permanently lost if the WebSocket connection is temporarily unavailable. However, the WebSocket path is the primary real-time delivery channel.
Connection endpoint
Connect to the WebSocket using the following URL format:Authentication
Every creator on Tuniform has a unique stream token — a 64-character hex string that acts as an API key. This token is passed as thetoken query parameter when connecting.
The creator’s unique 64-character hex stream token, passed as a query parameter.
Connection responses
| Scenario | HTTP Status | Response |
|---|---|---|
| Valid token | 101 Switching Protocols | WebSocket connection established |
| Missing token | 401 Unauthorized | "Missing 'token' query parameter" |
| Invalid or expired token | 401 Unauthorized | "Invalid or expired token" |
Handshake message
Immediately after a successful connection, the server sends a handshake confirmation message. This is always the first message received.Handshake Response
Always
"CONNECTED" for the handshake message.The creator’s Kick.com username. Empty string if not set.
The creator’s Tuniform user ID.
Message flow
Client connects
Open a WebSocket connection to
wss://stream-alerts.tuniform.tn/ws?token=<stream_token>.Server authenticates
The server validates the
token query parameter. Invalid tokens receive a 401 HTTP response.Key behaviors
Server → Client only
This is a one-way broadcast system. The server pushes events to connected clients. Messages sent by the client are ignored.
JSON text frames
Each event is sent as a WebSocket text frame containing a JSON-serialized object.
Creator-scoped
Events are scoped to the creator — you only receive events for the creator whose
stream_token you authenticated with.Automatic keep-alive
The server sends Ping frames automatically. Standard WebSocket clients handle Pong responses transparently — no action needed.
Next steps
Event payload schemas
Explore the full JSON schema for donation, subscription, and future event types.