StreamEvent Interface
Every event that flows through the VMSC rule engine shares a common structure. Below is the full StreamEvent interface in TypeScript notation.
interface StreamEvent {
id: string // Unique event identifier (UUID v4)
type: StreamEventType // One of the event types listed below
source: string // Origin platform: "tiktok", "twitch", "youtube", "kick", "streamlabs", "streamelements", "heartrate"
timestamp: number // Unix epoch in milliseconds
user: {
id: string
username: string
nickname: string
profilePictureUrl?: string
followRole?: number // 0 = none, 1 = follower, 2 = friend
isModerator?: boolean
isSubscriber?: boolean
}
data: Record<string, unknown> // Event-specific payload (see below)
raw?: any // Unprocessed source data (debug only)
}
ℹ️
About the raw field
The raw property contains the original, unprocessed event object from the platform SDK. It is included for debugging and advanced plugin use. Do not rely on its shape — it can change without notice between platform API versions.
chat
Fired when a viewer sends a chat message in the live stream.
| Field | Type | Description |
message |
string |
The full text content of the chat message. |
emotes |
string[] (optional) |
Array of emote identifiers included in the message, if any. |
gift
Fired when a viewer sends a gift. For streak gifts, multiple events fire with increasing repeatCount values. The final event in a streak has repeatEnd set to true.
| Field | Type | Description |
giftName |
string |
Display name of the gift (e.g. "Rose", "TikTok Universe"). |
giftId |
number |
Numeric identifier for the gift type. |
diamondCount |
number |
Diamond value of a single unit of this gift. |
repeatCount |
number |
Current count in a gift streak. Starts at 1. |
repeatEnd |
boolean |
Whether this is the final event in a gift streak. |
⚠️
Streak Gifts
When building rules that trigger on gifts, use the repeatEnd flag to avoid triggering multiple times during a single streak. A rule condition of repeatEnd == true ensures your action fires only once per completed gift streak.
like
Fired when a viewer taps the like button. TikTok batches likes, so each event may represent multiple taps.
| Field | Type | Description |
likeCount |
number |
Number of likes in this batch from the user. |
totalLikes |
number |
Running total of likes on the stream at the time of the event. |
follow
Fired when a viewer follows the streamer. This event carries no additional data fields beyond the base StreamEvent properties.
| Field | Type | Description |
No additional data fields. The user object on the base event identifies the new follower. |
share
Fired when a viewer shares the live stream. This event carries no additional data fields.
| Field | Type | Description |
No additional data fields. The user object identifies who shared the stream. |
join
Fired when a viewer joins the live stream. High-traffic streams may not report every join individually.
| Field | Type | Description |
No additional data fields. The user object identifies who joined. |
subscribe
Fired when a viewer subscribes to the streamer.
| Field | Type | Description |
subMonth |
number (optional) |
The subscriber's current month count, if reported by the platform. May be absent for first-time subscriptions. |
emote
Fired when a viewer sends a standalone emote (not part of a chat message).
| Field | Type | Description |
emoteId |
string |
Platform-specific identifier for the emote. |
viewer_count
Fired periodically to report the current viewer count. This is a stream-level event — the user field will contain a placeholder system user rather than a real viewer.
| Field | Type | Description |
viewerCount |
number |
Current number of viewers watching the stream. |
envelope
Fired when a viewer sends a treasure chest or coin envelope in the stream.
| Field | Type | Description |
envelopeId |
string |
Unique identifier for the envelope instance. |
coins |
number |
Number of coins contained in the envelope. |
Twitch Events
The following event types are available when Twitch is connected. The source field is set to "twitch".
| Event Type | Key Data Fields | Description |
chat | message, emotes?, badges? | A viewer sends a chat message. |
follow | none | A viewer follows the channel. |
subscribe | tier, isGift?, message? | A viewer subscribes to the channel. |
subscription_gift | tier, totalGifts, recipientUser? | A viewer gifts one or more subscriptions. |
cheer | bits, message? | A viewer cheers with bits. |
raid | fromBroadcaster, viewerCount | Another channel raids yours. |
channel_point_redeem | rewardId, rewardTitle, userInput? | A viewer redeems a channel point reward. |
poll_begin | pollId, title, choices[] | A poll starts on the channel. |
poll_progress | pollId, choices[].votes | Poll vote counts update. |
poll_end | pollId, winningChoice | A poll ends and results are final. |
prediction_begin | predictionId, title, outcomes[] | A prediction starts. |
prediction_progress | predictionId, outcomes[].points | Prediction point totals update. |
prediction_lock | predictionId | Prediction is locked (no more entries). |
prediction_end | predictionId, winningOutcome | Prediction resolves with a winner. |
hype_train_begin | level, total, goal | A hype train starts on the channel. |
hype_train_progress | level, total, goal | Hype train level or progress updates. |
hype_train_end | level, total | The hype train ends. |
ad_break | durationSeconds | An ad break begins on the channel. |
shoutout_create | targetUser, viewerCount? | The streamer sends a shoutout. |
shoutout_receive | fromBroadcaster, viewerCount? | The streamer receives a shoutout. |
ban | reason?, moderator?, isPermanent? | A viewer is banned or timed out. |
charity_donation | amount, currency, campaignId? | A viewer donates to a charity campaign. |
stream_online | startedAt | The channel goes live. |
stream_offline | none | The channel goes offline. |
YouTube Events
The following event types are available when YouTube is connected. The source field is set to "youtube".
| Event Type | Key Data Fields | Description |
chat | message, emotes? | A viewer sends a live chat message. |
super_chat | amount, currency, message? | A viewer sends a Super Chat with a monetary value. |
super_sticker | amount, currency, stickerId | A viewer sends a Super Sticker. |
membership_gift | tier, giftCount | A viewer gifts memberships to other viewers. |
member_milestone | memberMonths, message? | A member reaches a membership milestone. |
new_subscriber | none | A viewer subscribes to the YouTube channel. |
user_banned | reason?, moderator? | A viewer is banned from live chat. |
Kick Events
The following event types are available when Kick is connected. The source field is set to "kick".
| Event Type | Key Data Fields | Description |
chat | message, emotes? | A viewer sends a chat message. |
follow | none | A viewer follows the channel. |
subscribe | tier? | A viewer subscribes to the channel. |
gifted_sub | giftCount, recipientUser? | A viewer gifts subscriptions. |
Streamlabs Events
The following event types are available when Streamlabs is connected. The source field is set to "streamlabs".
| Event Type | Key Data Fields | Description |
donation | amount, currency, message? | A viewer sends a donation. |
follow | none | A viewer follows. |
subscription | tier?, months? | A viewer subscribes. |
host | viewerCount | Another channel hosts yours. |
bits | amount, message? | A viewer cheers with bits (Twitch via Streamlabs). |
raid | viewerCount | Another channel raids yours. |
merch | product, message? | A viewer purchases merchandise. |
StreamElements Events
The following event types are available when StreamElements is connected. The source field is set to "streamelements".
| Event Type | Key Data Fields | Description |
tip | amount, currency, message? | A viewer sends a tip. |
follow | none | A viewer follows. |
subscriber | tier?, months? | A viewer subscribes. |
cheer | amount, message? | A viewer cheers with bits. |
raid | viewerCount | Another channel raids yours. |
host | viewerCount | Another channel hosts yours. |
merch | product, message? | A viewer purchases merchandise. |
redemption | itemName, itemCost | A viewer redeems a store item. |
superchat | amount, currency, message? | A YouTube Super Chat (via StreamElements). |
community_gift | giftCount, tier? | A viewer gifts subscriptions to the community. |
Heart Rate Events
The following event type is available when a heart rate monitor is connected via Pulsoid or HypeRate. The source field is set to "heartrate".
| Event Type | Key Data Fields | Description |
bpm_update | bpm, measuredAt | A new heart rate reading is received from the connected sensor. Fires at the sensor's update interval (typically once per second). |
Quick Reference
Summary of all event types and their data payloads at a glance, organized by platform.
TikTok
| Event Type | Data Fields | Notes |
chat | message, emotes? | Most common trigger for rules |
gift | giftName, giftId, diamondCount, repeatCount, repeatEnd | Filter on repeatEnd for streaks |
like | likeCount, totalLikes | Batched by platform |
follow | none | |
share | none | |
join | none | May be throttled on busy streams |
subscribe | subMonth? | |
emote | emoteId | Standalone emotes only |
viewer_count | viewerCount | System event, no real user |
envelope | envelopeId, coins | |
Twitch
| Event Type | Data Fields | Notes |
chat | message, emotes?, badges? | |
follow | none | |
subscribe | tier, isGift?, message? | |
subscription_gift | tier, totalGifts, recipientUser? | |
cheer | bits, message? | |
raid | fromBroadcaster, viewerCount | |
channel_point_redeem | rewardId, rewardTitle, userInput? | |
poll_begin / poll_progress / poll_end | pollId, title, choices[] | |
prediction_begin / progress / lock / end | predictionId, title, outcomes[] | |
hype_train_begin / progress / end | level, total, goal | |
ad_break | durationSeconds | |
shoutout_create / shoutout_receive | targetUser or fromBroadcaster | |
ban | reason?, moderator?, isPermanent? | |
charity_donation | amount, currency, campaignId? | |
stream_online / stream_offline | startedAt / none | |
YouTube
| Event Type | Data Fields | Notes |
chat | message, emotes? | |
super_chat | amount, currency, message? | |
super_sticker | amount, currency, stickerId | |
membership_gift | tier, giftCount | |
member_milestone | memberMonths, message? | |
new_subscriber | none | |
user_banned | reason?, moderator? | |
Kick
| Event Type | Data Fields | Notes |
chat | message, emotes? | |
follow | none | |
subscribe | tier? | |
gifted_sub | giftCount, recipientUser? | |
Streamlabs
| Event Type | Data Fields | Notes |
donation | amount, currency, message? | |
follow | none | |
subscription | tier?, months? | |
host | viewerCount | |
bits | amount, message? | |
raid | viewerCount | |
merch | product, message? | |
StreamElements
| Event Type | Data Fields | Notes |
tip | amount, currency, message? | |
follow | none | |
subscriber | tier?, months? | |
cheer | amount, message? | |
raid | viewerCount | |
host | viewerCount | |
merch | product, message? | |
redemption | itemName, itemCost | |
superchat | amount, currency, message? | |
community_gift | giftCount, tier? | |
Heart Rate
| Event Type | Data Fields | Notes |
bpm_update | bpm, measuredAt | From Pulsoid or HypeRate |