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 using path /ws first and wait for an eventsub message where metadata.messageType is session_welcome. 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, handle session_welcome messages, then branch notifications on metadata.subscriptionType before reading the payload.

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

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

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;

  if (metadata.messageType === "session_welcome") {
    const { sessionId } = payload;
    // Send this sessionId to your backend before creating subscriptions.
    console.log("Socket.IO session ready", sessionId);
    return;
  }

  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.thanks

A user sends thanks in the channel.

Accepted auth typeUser access token

Example

{
  "metadata": {
    "messageType": "notification",
    "subscriptionType": "channel.thanks"
  },
  "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"
    },
    "thanksId": "1d9a6f4b-3e8c-4a25-9f61-6b0c2d7e8a91",
    "messageId": "c3d7f0a2-9e6b-4b1d-8a55-1b2c3d4e5f60",
    "message": "Thanks for the stream!",
    "amount": "100",
    "createdAt": "2026-05-04T12:00:00.000Z"
  }
}

channel.vote

A user casts a vote in the channel.

Accepted auth typeUser access token

Example

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

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"
  }
}

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
  }
}