Events

Event Types

Event Types describe how EventSub notifications are delivered through the eventsub socket event for each subscription type. Blaze uses Socket.IO for this real-time connection, so native browser WebSocket clients are not compatible. Each event lists its accepted auth type: some can be subscribed to with either user access tokens or app access tokens, while user-only events require a user access token.

Handling EventSub

Connect with a Socket.IO client to https://blaze.stream/ws first and wait for the session_welcome event. After a subscription is created, Blaze emits matching notifications to that Socket.IO session. Listen for the eventsub event, parse the message as an object, then branch on metadata.subscriptionType before reading the payload.

import { io } from "socket.io-client";

const socket = io("https://blaze.stream/ws", {
  transports: ["websocket"],
});

socket.on("session_welcome", ({ sessionId }) => {
  // Send this sessionId to your backend before creating subscriptions.
  console.log("Socket.IO session ready", sessionId);
});

const handlers = {
  "channel.follow": ({ channelId, follower }) => {
    console.log(`${follower.username} followed ${channelId}`);
  },
  "channel.chat.message": ({ message, sender }) => {
    console.log(`${sender.username}: ${message}`);
  },
};

socket.on("eventsub", (message) => {
  const { metadata, payload } = message;
  const handler = handlers[metadata.subscriptionType];

  if (!handler) {
    console.warn("Unhandled EventSub notification", metadata.subscriptionType);
    return;
  }

  handler(payload);
});

socket.on("connect_error", (error) => {
  console.error("Socket.IO connection failed", error.message);
});

Payload Types

The payloads below are built by the queue hook worker before broadcasting to the socket service. Each section shows the subscription type, accepted auth type, and a representative example. When both auth badges are shown, either token type can subscribe to that event; when only User access token is shown, app access tokens are not accepted for that event.

channel.follow

A user follows the channel.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.follow"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "follower": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png",
      "followedAt": "2026-05-04T12:00:00.000Z"
    }
  }
}

channel.unfollow

A user unfollows the channel.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.unfollow"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "follower": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.subscribe

A user subscribes to the channel.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.subscribe"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "subscriber": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png",
      "subscribedAt": "2026-05-04T12:00:00.000Z",
      "subscriptionExpiresAt": "2026-06-04T12:00:00.000Z"
    }
  }
}

channel.subscription.gift

A gift subscription batch is granted for the channel.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.subscription.gift"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "sender": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    },
    "giftCount": 5
  }
}

channel.chat.message

A chat message is sent in the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.chat.message"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "sender": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png",
      "roles": [
        "moderator"
      ],
      "isBot": false,
      "isSubscriber": true,
      "isFollower": true,
      "isOwner": false
    },
    "messageId": "c3d7f0a2-9e6b-4b1d-8a55-1b2c3d4e5f60",
    "message": "Hello Blaze",
    "createdAt": "2026-05-04T12:00:00.000Z",
    "roles": [
      "moderator"
    ],
    "isSubscriber": true,
    "isFollower": true,
    "isOwner": false
  }
}

channel.chat.clear

Channel chat is cleared by a user.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.chat.clear"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "clearedBy": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    },
    "createdAt": "2026-05-04T12:00:00.000Z"
  }
}

channel.chat.message_delete

A specific chat message is deleted.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.chat.message_delete"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "deletedBy": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    },
    "messageId": "c3d7f0a2-9e6b-4b1d-8a55-1b2c3d4e5f60",
    "deletedAt": "2026-05-04T12:00:00.000Z",
    "targetUser": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.moderate

A moderation action is applied in the channel.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.moderate"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "action": "mute",
    "moderator": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    },
    "targetUser": {
      "id": "7a4f9c2e-5b8d-4c11-9d3a-1f6e8b2c0a44",
      "username": "target",
      "displayName": "Target User",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    },
    "messageId": "c3d7f0a2-9e6b-4b1d-8a55-1b2c3d4e5f60",
    "muteExpiresAt": "2026-05-04T12:10:00.000Z"
  }
}

channel.ban

A user is banned from the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.ban"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "bannedUser": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.unban

A user is unbanned from the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.unban"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "unbannedUser": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.moderator.add

A moderator is added to the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.moderator.add"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "moderator": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.moderator.remove

A moderator is removed from the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.moderator.remove"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "moderator": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.vip.add

A VIP user is added to the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.vip.add"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "vip": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.vip.remove

A VIP user is removed from the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.vip.remove"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "vip": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.og.add

An OG user is added to the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.og.add"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "og": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.og.remove

An OG user is removed from the channel.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.og.remove"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "og": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.raid

A channel raid is received.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.raid"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "raider": {
      "id": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
      "username": "creator",
      "displayName": "Creator",
      "avatarUrl": "https://cdn.blaze.stream/avatar.png"
    }
  }
}

channel.update

Channel metadata or live stream fields are updated.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.update"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "updatedFields": [
      "displayName",
      "bio"
    ],
    "updatedLiveStreamFields": [
      "title",
      "category"
    ]
  }
}

user.update

A user's profile fields are updated.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "user.update"
  },
  "payload": {
    "userId": "2f4c6d9a-8e2b-4d77-9f0d-3a1b2c4d5e6f",
    "updatedFields": [
      "displayName",
      "avatarUrl"
    ]
  }
}

stream.online

The channel goes live.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "stream.online"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "liveStreamId": "5e1b8d7c-4f3a-463b-9c2d-8a7e5f1b9c04",
    "isLive": true,
    "title": "Live now",
    "category": {
      "id": 12,
      "parentId": null,
      "name": "Just Chatting",
      "slug": "just-chatting",
      "imageUrl": "https://cdn.blaze.stream/uploads/category.png"
    },
    "streamStartedAt": "2026-05-04T12:00:00.000Z",
    "streamUrl": "https://live.blaze.stream/live/index.m3u8",
    "dvrUrl": "https://live.blaze.stream/dvr/index.m3u8",
    "previewImgUrl": "https://cdn.blaze.stream/preview.jpg",
    "version": 3
  }
}

stream.offline

The channel goes offline.

Accepted auth typeUser access tokenApp access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "stream.offline"
  },
  "payload": {
    "channelId": "9b7f3c2a-2f41-4f5e-9f54-6c1d8a2b7e90",
    "liveStreamId": "5e1b8d7c-4f3a-463b-9c2d-8a7e5f1b9c04",
    "isLive": false,
    "title": "Live now",
    "category": {
      "id": 12,
      "parentId": null,
      "name": "Just Chatting",
      "slug": "just-chatting",
      "imageUrl": "https://cdn.blaze.stream/uploads/category.png"
    },
    "streamStartedAt": "2026-05-04T12:00:00.000Z",
    "streamEndedAt": "2026-05-04T13:10:00.000Z",
    "streamUrl": "https://live.blaze.stream/live/index.m3u8",
    "dvrUrl": "https://live.blaze.stream/recording.mp4",
    "previewImgUrl": "https://cdn.blaze.stream/preview.jpg",
    "version": 3,
    "status": 4,
    "durationSeconds": 4200
  }
}