Twitch.BroadcastUpdate

WebSocket event schema, payload, and examples

Properties

channelId
string
channel
string
status
string
oldStatus
string
oldGame
object required
game
object required
is_test
boolean required

Schema

The JSON Schema for the event payload, if available.
schema.json
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "TwitchChannelUpdateEvent",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "channelId": {
      "type": [
        "null",
        "string"
      ]
    },
    "channel": {
      "type": [
        "null",
        "string"
      ]
    },
    "status": {
      "type": [
        "null",
        "string"
      ]
    },
    "oldStatus": {
      "type": [
        "null",
        "string"
      ]
    },
    "oldGame": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/GameInfo"
        }
      ]
    },
    "game": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/GameInfo"
        }
      ]
    },
    "is_test": {
      "type": "boolean"
    }
  },
  "definitions": {
    "GameInfo": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "box_art_url": {
          "type": [
            "null",
            "string"
          ]
        },
        "igdb_id": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    }
  }
}

JSON Payload

An example JSON payload for the event, automatically generated using JSONSchemaFaker
example.json
{
  "channel": null,
  "channelId": "sunt ut Excepteur aute nisi",
  "game": {
    "box_art_url": "qui",
    "id": "laboris sunt officia",
    "igdb_id": "Duis sint Lorem enim reprehenderit",
    "name": "laborum occaecat"
  },
  "is_test": false,
  "oldGame": {
    "box_art_url": "anim mollit elit",
    "id": "sed dolore in ea",
    "igdb_id": "cillum",
    "name": null
  },
  "oldStatus": null,
  "status": null
}

Client Example

Example code showing how to subscribe to this event using the Streamer.bot WebSocket Client
index.js
// Initialize the Streamer.bot WebSocket Client
const client = new StreamerbotClient();

// Subscribe to "Twitch.BroadcastUpdate" events and register a callback
client.on('Twitch.BroadcastUpdate', ({ event, data }) => {
  // Code here will run every time the event is received!
  console.log('Received event:', event.source, event.type);
  console.log('Event data:', data);
});