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.

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

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

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

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

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

FieldTypeDescription
No additional data fields. The user object identifies who joined.

subscribe

Fired when a viewer subscribes to the streamer.

FieldTypeDescription
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).

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

FieldTypeDescription
viewerCount number Current number of viewers watching the stream.

envelope

Fired when a viewer sends a treasure chest or coin envelope in the stream.

FieldTypeDescription
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 TypeKey Data FieldsDescription
chatmessage, emotes?, badges?A viewer sends a chat message.
follownoneA viewer follows the channel.
subscribetier, isGift?, message?A viewer subscribes to the channel.
subscription_gifttier, totalGifts, recipientUser?A viewer gifts one or more subscriptions.
cheerbits, message?A viewer cheers with bits.
raidfromBroadcaster, viewerCountAnother channel raids yours.
channel_point_redeemrewardId, rewardTitle, userInput?A viewer redeems a channel point reward.
poll_beginpollId, title, choices[]A poll starts on the channel.
poll_progresspollId, choices[].votesPoll vote counts update.
poll_endpollId, winningChoiceA poll ends and results are final.
prediction_beginpredictionId, title, outcomes[]A prediction starts.
prediction_progresspredictionId, outcomes[].pointsPrediction point totals update.
prediction_lockpredictionIdPrediction is locked (no more entries).
prediction_endpredictionId, winningOutcomePrediction resolves with a winner.
hype_train_beginlevel, total, goalA hype train starts on the channel.
hype_train_progresslevel, total, goalHype train level or progress updates.
hype_train_endlevel, totalThe hype train ends.
ad_breakdurationSecondsAn ad break begins on the channel.
shoutout_createtargetUser, viewerCount?The streamer sends a shoutout.
shoutout_receivefromBroadcaster, viewerCount?The streamer receives a shoutout.
banreason?, moderator?, isPermanent?A viewer is banned or timed out.
charity_donationamount, currency, campaignId?A viewer donates to a charity campaign.
stream_onlinestartedAtThe channel goes live.
stream_offlinenoneThe channel goes offline.

YouTube Events

The following event types are available when YouTube is connected. The source field is set to "youtube".

Event TypeKey Data FieldsDescription
chatmessage, emotes?A viewer sends a live chat message.
super_chatamount, currency, message?A viewer sends a Super Chat with a monetary value.
super_stickeramount, currency, stickerIdA viewer sends a Super Sticker.
membership_gifttier, giftCountA viewer gifts memberships to other viewers.
member_milestonememberMonths, message?A member reaches a membership milestone.
new_subscribernoneA viewer subscribes to the YouTube channel.
user_bannedreason?, 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 TypeKey Data FieldsDescription
chatmessage, emotes?A viewer sends a chat message.
follownoneA viewer follows the channel.
subscribetier?A viewer subscribes to the channel.
gifted_subgiftCount, 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 TypeKey Data FieldsDescription
donationamount, currency, message?A viewer sends a donation.
follownoneA viewer follows.
subscriptiontier?, months?A viewer subscribes.
hostviewerCountAnother channel hosts yours.
bitsamount, message?A viewer cheers with bits (Twitch via Streamlabs).
raidviewerCountAnother channel raids yours.
merchproduct, 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 TypeKey Data FieldsDescription
tipamount, currency, message?A viewer sends a tip.
follownoneA viewer follows.
subscribertier?, months?A viewer subscribes.
cheeramount, message?A viewer cheers with bits.
raidviewerCountAnother channel raids yours.
hostviewerCountAnother channel hosts yours.
merchproduct, message?A viewer purchases merchandise.
redemptionitemName, itemCostA viewer redeems a store item.
superchatamount, currency, message?A YouTube Super Chat (via StreamElements).
community_giftgiftCount, 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 TypeKey Data FieldsDescription
bpm_updatebpm, measuredAtA 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 TypeData FieldsNotes
chatmessage, emotes?Most common trigger for rules
giftgiftName, giftId, diamondCount, repeatCount, repeatEndFilter on repeatEnd for streaks
likelikeCount, totalLikesBatched by platform
follownone
sharenone
joinnoneMay be throttled on busy streams
subscribesubMonth?
emoteemoteIdStandalone emotes only
viewer_countviewerCountSystem event, no real user
envelopeenvelopeId, coins

Twitch

Event TypeData FieldsNotes
chatmessage, emotes?, badges?
follownone
subscribetier, isGift?, message?
subscription_gifttier, totalGifts, recipientUser?
cheerbits, message?
raidfromBroadcaster, viewerCount
channel_point_redeemrewardId, rewardTitle, userInput?
poll_begin / poll_progress / poll_endpollId, title, choices[]
prediction_begin / progress / lock / endpredictionId, title, outcomes[]
hype_train_begin / progress / endlevel, total, goal
ad_breakdurationSeconds
shoutout_create / shoutout_receivetargetUser or fromBroadcaster
banreason?, moderator?, isPermanent?
charity_donationamount, currency, campaignId?
stream_online / stream_offlinestartedAt / none

YouTube

Event TypeData FieldsNotes
chatmessage, emotes?
super_chatamount, currency, message?
super_stickeramount, currency, stickerId
membership_gifttier, giftCount
member_milestonememberMonths, message?
new_subscribernone
user_bannedreason?, moderator?

Kick

Event TypeData FieldsNotes
chatmessage, emotes?
follownone
subscribetier?
gifted_subgiftCount, recipientUser?

Streamlabs

Event TypeData FieldsNotes
donationamount, currency, message?
follownone
subscriptiontier?, months?
hostviewerCount
bitsamount, message?
raidviewerCount
merchproduct, message?

StreamElements

Event TypeData FieldsNotes
tipamount, currency, message?
follownone
subscribertier?, months?
cheeramount, message?
raidviewerCount
hostviewerCount
merchproduct, message?
redemptionitemName, itemCost
superchatamount, currency, message?
community_giftgiftCount, tier?

Heart Rate

Event TypeData FieldsNotes
bpm_updatebpm, measuredAtFrom Pulsoid or HypeRate