Once your app is connected to a GameWisp channel, you can listen on the following events to receive data about that channel in real time.
These events work for all connected channels
Remember, if you're connected to multiple GameWisp channels on Singularity, the following real-time events will fire per channel. This makes it possible to use the same event listeners to handle data from multiple channels in real time!
Basic Real-Time Event Structure
Singularity's real-time events are those fire automatically whenever an event occurs in the GameWisp application. Currently there are ten real-time events your application can listen on in order to receive data. Pick and choose the events that pertain to your particular use case. Data from real-time events is JSON formatted, and will have the following basic structure:
{
event: "event-name",
channel_id: "channel identifier",
channel: {
names: {
gamewisp: "GameWisp channel name",
twitch: "twitch channel name",
youtube: "youtube channel name"
},
ids: {
gamewisp: "channel identifier",
twitch: "12312312q",
youtube: "UCiqp4J8asdkssssssssdfae"
}
}
data: {
//data for the particular event.
}
}
The channel object contains channel identifying information for GameWisp and any platform the channel may have linked to GameWisp (i.e., Twitch and/or YouTube).
The data object contains information pertaining to the event. This object is unique for every event type, but contains some common elements that are described as follows:
ids: {
gamewisp: "1111",
twitch: "22222222",
youtube: "39sdfadfs"
},
Property | Type | Description |
---|---|---|
gamewisp | integer - potentially string formatted | The unique GameWisp ID of the contained object. This could be a channel ID, subscriber ID, user ID, etc. |
twitch | integer - potentially string formatted | The twitch ID of the object (e.g., user, twitch channel, etc.) Is null if the contained object is not linked to Twitch |
youtube | string | The YouTube identifier of the object. This can be null if the object does not have a link to YouTube. |
names: {
gamewisp: "GameWisp channel name",
twitch: "twitch channel name",
youtube: "youtube channel name"
},
Similar to the table above, each entry is the channel name for the channel's GameWisp, Twitch, and YouTube channel. Fields will be null if the channel has not linked the corresponding service.
What Next?
Now that you know the basic structure of each real-time event. Check out the Singularity: Real-Time Events section of this documentation for a thorough description of each event.