Receiving Events
Learn how to subscribe to and handle events from the WebSocket server
Subscribing to Events
In order to receive events from the WebSocket server, you must first subscribe to them.
When using the Streamer.bot Client library and its
.on()
method, this is handled automatically!Documentation Needed
This section is missing documentation. If you'd like to help out, please consider contributing on GitHub!
This section is missing documentation. If you'd like to help out, please consider contributing on GitHub!
Event Schema
All events are sent from the server in stringified JSON format.
Event payloads follow the following base schema:
{
"timeStamp": Date, // ISO 8601 DateTime
"event": {
"source": string,
"type": string
},
"data": {
// Data for the respective event
}
}
{
"timeStamp": "2022-01-30T21:32:04.4588947-05:00",
"event": {
"source": "Twitch",
"type": "ChatMessage"
},
"data": {
// Twitch Chat Message Data
}
}
timeStamp
Date required
The timestamp of when the event was emitted
event.source
string required
The source of the event, e.g.
Twitch
, YouTube
, OBS
, etc.event.type
string required
The type of event, e.g.
ChatMessage
, StreamStart
, SceneChanged
, etc.data
object
The event data, which varies depending on the event source and type