Overview
Methods
- createConduita
- createSubscriptiona
- deleteAllSubscriptionsa
- deleteBrokenSubscriptionsa
- deleteConduita
- deleteSubscriptiona
- getConduitsa
- getConduitShardsa
- getConduitShardsPaginated
- getSubscriptionsa
- getSubscriptionsForStatusa
- getSubscriptionsForStatusPaginated
- getSubscriptionsForTypea
- getSubscriptionsForTypePaginated
- getSubscriptionsForUsera
- getSubscriptionsForUserPaginated
- getSubscriptionsPaginated
- subscribeToChannelAdBreakBeginEventsa
- subscribeToChannelBanEventsa
- subscribeToChannelCharityCampaignProgressEventsa
- subscribeToChannelCharityCampaignStartEventsa
- subscribeToChannelCharityCampaignStopEventsa
- subscribeToChannelCharityDonationEventsa
- subscribeToChannelChatClearEventsa
- subscribeToChannelChatClearUserMessagesEventsa
- subscribeToChannelChatMessageDeleteEventsa
- subscribeToChannelChatMessageEventsa
- subscribeToChannelChatNotificationEventsa
- subscribeToChannelChatSettingsUpdateEventsa
- subscribeToChannelCheerEventsa
- subscribeToChannelFollowEventsa
- subscribeToChannelGoalBeginEventsa
- subscribeToChannelGoalEndEventsa
- subscribeToChannelGoalProgressEventsa
- subscribeToChannelHypeTrainBeginEventsa
- subscribeToChannelHypeTrainEndEventsa
- subscribeToChannelHypeTrainProgressEventsa
- subscribeToChannelModeratorAddEventsa
- subscribeToChannelModeratorRemoveEventsa
- subscribeToChannelPollBeginEventsa
- subscribeToChannelPollEndEventsa
- subscribeToChannelPollProgressEventsa
- subscribeToChannelPredictionBeginEventsa
- subscribeToChannelPredictionEndEventsa
- subscribeToChannelPredictionLockEventsa
- subscribeToChannelPredictionProgressEventsa
- subscribeToChannelRaidEventsFroma
- subscribeToChannelRaidEventsToa
- subscribeToChannelRedemptionAddEventsa
- subscribeToChannelRedemptionAddEventsForRewarda
- subscribeToChannelRedemptionUpdateEventsa
- subscribeToChannelRedemptionUpdateEventsForRewarda
- subscribeToChannelRewardAddEventsa
- subscribeToChannelRewardRemoveEventsa
- subscribeToChannelRewardRemoveEventsForRewarda
- subscribeToChannelRewardUpdateEventsa
- subscribeToChannelRewardUpdateEventsForRewarda
- subscribeToChannelShieldModeBeginEventsa
- subscribeToChannelShieldModeEndEventsa
- subscribeToChannelShoutoutCreateEventsa
- subscribeToChannelShoutoutReceiveEventsa
- subscribeToChannelSubscriptionEndEventsa
- subscribeToChannelSubscriptionEventsa
- subscribeToChannelSubscriptionGiftEventsa
- subscribeToChannelSubscriptionMessageEventsa
- subscribeToChannelUnbanEventsa
- subscribeToChannelUpdateEventsa
- subscribeToDropEntitlementGrantEventsa
- subscribeToExtensionBitsTransactionCreateEventsa
- subscribeToStreamOfflineEventsa
- subscribeToStreamOnlineEventsa
- subscribeToUserAuthorizationGrantEventsa
- subscribeToUserAuthorizationRevokeEventsa
- subscribeToUserUpdateEventsa
- updateConduita
- updateConduitShardsa
Can be accessed using client.eventSub
on an ApiClient instance.
Before using these methods...
All methods in this class assume that you are already running a working EventSub listener reachable using the given transport.
If you don't already have one, we recommend use of the @twurple/eventsub-http
or @twurple/eventsub-ws
libraries,
which handle subscribing and unsubscribing to these topics automatically.
Example
const api = new ApiClient({ authProvider });
await api.eventSub.subscribeToUserFollowsTo('125328655', { callbackUrl: 'https://example.com' });
Methods
createConduit(shardCount)
asyncCreates a new EventSub conduit for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
shardCount | number | none | The number of shards to create for this conduit. |
createSubscription(type, version, condition, transport, user, requiredScopeSet, canOverrideScopedUserContext, isBatched)
asyncSends an arbitrary request to subscribe to an event.
You can only create WebHook transport subscriptions using app tokens and WebSocket transport subscriptions using user tokens.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
type | string | none | The type of the event. | |
version | string | none | The version of the event. | |
condition | Record<string, unknown> | none | The condition of the subscription. | |
transport | HelixEventSubTransportOptions | none | The transport of the subscription. | |
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to create the subscription in context of. | |
requiredScopeSet | string[] | none | The scope set required by the subscription. Will only be checked for applicable transports. | |
canOverrideScopedUserContext | boolean | none | Whether the auth user context can be overridden. | |
isBatched | boolean | none | Whether to enable batching for the subscription. Is only supported for select topics. |
deleteBrokenSubscriptions()
asyncDeletes all broken subscriptions, i.e. all that are not enabled or pending verification.
deleteConduit(id)
asyncDeletes an EventSub conduit for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
id | string | none | The ID of the conduit to delete. |
deleteSubscription(id)
asyncDeletes a subscription.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
id | string | none | The ID of the subscription. |
getConduits()
asyncGets the current EventSub conduits for the current client.
getConduitShards(conduitId, status, pagination)
asyncGets the shards of an EventSub conduit for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
conduitId | string | none | The ID of the conduit to get shards for. | |
status | HelixEventSubSubscriptionStatus Aliased type: "enabled" | "webhook_callback_verification_pending" | "webhook_callback_verification_failed" | "notification_failures_exceeded" | "authorization_revoked" | "moderator_removed" | "user_removed" | "version_removed" | "beta_maintenance" | "websocket_disconnected" | "websocket_failed_ping_pong" | "websocket_received_inbound_traffic" | "websocket_connection_unused" | "websocket_internal_error" | "websocket_network_timeout" | "websocket_network_error" | "conduit_deleted" | none | The status of the shards to filter by. | |
pagination | HelixPagination | none | none |
getConduitShardsPaginated(conduitId, status)
Creates a paginator for the shards of an EventSub conduit for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
conduitId | string | none | The ID of the conduit to get shards for. | |
status | HelixEventSubSubscriptionStatus Aliased type: "enabled" | "webhook_callback_verification_pending" | "webhook_callback_verification_failed" | "notification_failures_exceeded" | "authorization_revoked" | "moderator_removed" | "user_removed" | "version_removed" | "beta_maintenance" | "websocket_disconnected" | "websocket_failed_ping_pong" | "websocket_received_inbound_traffic" | "websocket_connection_unused" | "websocket_internal_error" | "websocket_network_timeout" | "websocket_network_error" | "conduit_deleted" | none | The status of the shards to filter by. |
getSubscriptions(pagination)
asyncGets the current EventSub subscriptions for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
pagination | HelixPagination | none | see below | |
pagination.after | string | none | A cursor to get the following page of. | |
pagination.before | string | none | A cursor to get the previous page of. | |
pagination.limit | number | none | The number of results per page. |
getSubscriptionsForStatus(status, pagination)
asyncGets the current EventSub subscriptions with the given status for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
status | HelixEventSubSubscriptionStatus Aliased type: "enabled" | "webhook_callback_verification_pending" | "webhook_callback_verification_failed" | "notification_failures_exceeded" | "authorization_revoked" | "moderator_removed" | "user_removed" | "version_removed" | "beta_maintenance" | "websocket_disconnected" | "websocket_failed_ping_pong" | "websocket_received_inbound_traffic" | "websocket_connection_unused" | "websocket_internal_error" | "websocket_network_timeout" | "websocket_network_error" | "conduit_deleted" | none | The status of the subscriptions to get. | |
pagination | HelixPagination | none | see below | |
pagination.after | string | none | A cursor to get the following page of. | |
pagination.before | string | none | A cursor to get the previous page of. | |
pagination.limit | number | none | The number of results per page. |
getSubscriptionsForStatusPaginated(status)
Creates a paginator for the current EventSub subscriptions with the given status for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
status | HelixEventSubSubscriptionStatus Aliased type: "enabled" | "webhook_callback_verification_pending" | "webhook_callback_verification_failed" | "notification_failures_exceeded" | "authorization_revoked" | "moderator_removed" | "user_removed" | "version_removed" | "beta_maintenance" | "websocket_disconnected" | "websocket_failed_ping_pong" | "websocket_received_inbound_traffic" | "websocket_connection_unused" | "websocket_internal_error" | "websocket_network_timeout" | "websocket_network_error" | "conduit_deleted" | none | The status of the subscriptions to get. |
getSubscriptionsForType(type, pagination)
asyncGets the current EventSub subscriptions with the given type for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
type | string | none | The type of the subscriptions to get. | |
pagination | HelixPagination | none | see below | |
pagination.after | string | none | A cursor to get the following page of. | |
pagination.before | string | none | A cursor to get the previous page of. | |
pagination.limit | number | none | The number of results per page. |
getSubscriptionsForTypePaginated(type)
Creates a paginator for the current EventSub subscriptions with the given type for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
type | string | none | The type of the subscriptions to get. |
getSubscriptionsForUser(user, pagination)
asyncGets the current EventSub subscriptions for the current user and client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to get subscriptions for. | |
pagination | HelixPagination | none | see below | |
pagination.after | string | none | A cursor to get the following page of. | |
pagination.before | string | none | A cursor to get the previous page of. | |
pagination.limit | number | none | The number of results per page. |
getSubscriptionsForUserPaginated(user)
Creates a paginator for the current EventSub subscriptions with the given type for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to get subscriptions for. |
getSubscriptionsPaginated()
Creates a paginator for the current EventSub subscriptions for the current client.
subscribeToChannelAdBreakBeginEvents(broadcaster, transport)
asyncSubscribe to events that represent an ad break beginning in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to ad break begin events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelBanEvents(broadcaster, transport)
asyncSubscribe to events that represent a user being banned in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to ban events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelCharityCampaignProgressEvents(broadcaster, transport)
asyncSubscribe to events that represent a charity campaign progressing in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to charity donation events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelCharityCampaignStartEvents(broadcaster, transport)
asyncSubscribe to events that represent a charity campaign starting in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to charity donation events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelCharityCampaignStopEvents(broadcaster, transport)
asyncSubscribe to events that represent a charity campaign ending in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to charity donation events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelCharityDonationEvents(broadcaster, transport)
asyncSubscribe to events that represent a user donating to a charity campaign in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to charity donation events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelChatClearEvents(broadcaster, transport)
asyncSubscribe to events that represent a channel's chat being cleared.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to chat clear events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelChatClearUserMessagesEvents(broadcaster, transport)
asyncSubscribe to events that represent a user's chat messages being cleared in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to user chat message clear events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelChatMessageDeleteEvents(broadcaster, transport)
asyncSubscribe to events that represent a chat message being deleted in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to chat message delete events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelChatMessageEvents(broadcaster, transport)
asyncSubscribe to events that represent a chat message in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to chat message events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelChatNotificationEvents(broadcaster, transport)
asyncSubscribe to events that represent a chat notification in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to chat notification events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelChatSettingsUpdateEvents(broadcaster, transport)
asyncSubscribe to events that represent chat settings being updated in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to chat settings update events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelCheerEvents(broadcaster, transport)
asyncSubscribe to events that represent a user cheering bits to a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to cheer events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelFollowEvents(broadcaster, transport)
asyncSubscribe to events that represent a user following a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to follow events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelGoalBeginEvents(broadcaster, transport)
asyncSubscribe to events that represent the beginning of a creator goal event in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to goal begin events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelGoalEndEvents(broadcaster, transport)
asyncSubscribe to events that represent the end of a creator goal event.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to goal end events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelGoalProgressEvents(broadcaster, transport)
asyncSubscribe to events that represent progress towards a creator goal.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to goal progress events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelHypeTrainBeginEvents(broadcaster, transport)
asyncSubscribe to events that represent the beginning of a Hype Train event in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to Hype train begin events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelHypeTrainEndEvents(broadcaster, transport)
asyncSubscribe to events that represent the end of a Hype Train event.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to Hype Train end events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelHypeTrainProgressEvents(broadcaster, transport)
asyncSubscribe to events that represent progress towards the Hype Train goal.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to Hype Train progress events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelModeratorAddEvents(broadcaster, transport)
asyncSubscribe to events that represent a moderator being added to a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen for moderator add events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelModeratorRemoveEvents(broadcaster, transport)
asyncSubscribe to events that represent a moderator being removed from a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen for moderator remove events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelPollBeginEvents(broadcaster, transport)
asyncSubscribe to events that represent a poll starting in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to poll begin events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelPollEndEvents(broadcaster, transport)
asyncSubscribe to events that represent a poll ending in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to poll end events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelPollProgressEvents(broadcaster, transport)
asyncSubscribe to events that represent a poll being voted on in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to poll progress events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelPredictionBeginEvents(broadcaster, transport)
asyncSubscribe to events that represent a prediction starting in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to prediction begin events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelPredictionEndEvents(broadcaster, transport)
asyncSubscribe to events that represent a prediction ending in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to prediction end events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelPredictionLockEvents(broadcaster, transport)
asyncSubscribe to events that represent a prediction being locked in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to prediction lock events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelPredictionProgressEvents(broadcaster, transport)
asyncSubscribe to events that represent a prediction being voted on in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to prediction preogress events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRaidEventsFrom(broadcaster, transport)
asyncSubscribe to events that represent a broadcaster raiding another broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to outgoing raid events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRaidEventsTo(broadcaster, transport)
asyncSubscribe to events that represent a broadcaster being raided by another broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to incoming raid events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRedemptionAddEvents(broadcaster, transport)
asyncSubscribe to events that represent a Channel Points reward being redeemed.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to redemption events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRedemptionAddEventsForReward(broadcaster, rewardId, transport)
asyncSubscribe to events that represent a specific Channel Points reward being redeemed.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to redemption events for. | |
rewardId | string | none | The ID of the reward you want to listen to redemption events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRedemptionUpdateEvents(broadcaster, transport)
asyncSubscribe to events that represent a Channel Points redemption being updated.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to redemption update events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRedemptionUpdateEventsForReward(broadcaster, rewardId, transport)
asyncSubscribe to events that represent a specific Channel Points reward's redemption being updated.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to redemption update events for. | |
rewardId | string | none | The ID of the reward you want to listen to redemption updates for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRewardAddEvents(broadcaster, transport)
asyncSubscribe to events that represent a Channel Points reward being added to a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to reward add events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRewardRemoveEvents(broadcaster, transport)
asyncSubscribe to events that represent a Channel Points reward being removed from a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to reward remove events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRewardRemoveEventsForReward(broadcaster, rewardId, transport)
asyncSubscribe to events that represent a specific Channel Points reward being removed from a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to reward remove events for. | |
rewardId | string | none | The ID of the reward you want to listen to remove events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRewardUpdateEvents(broadcaster, transport)
asyncSubscribe to events that represent a Channel Points reward being updated in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to reward update events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelRewardUpdateEventsForReward(broadcaster, rewardId, transport)
asyncSubscribe to events that represent a specific Channel Points reward being updated.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to reward update events for. | |
rewardId | string | none | The ID of the reward you want to listen to update events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelShieldModeBeginEvents(broadcaster, transport)
asyncSubscribe to events that represent Shield Mode being activated in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to Shield Mode activation events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelShieldModeEndEvents(broadcaster, transport)
asyncSubscribe to events that represent Shield Mode being deactivated in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to Shield Mode deactivation events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelShoutoutCreateEvents(broadcaster, transport)
asyncSubscribe to events that represent a broadcaster shouting out another broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to outgoing shoutout events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelShoutoutReceiveEvents(broadcaster, transport)
asyncSubscribe to events that represent a broadcaster being shouting out by another broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which you want to listen to incoming shoutout events. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelSubscriptionEndEvents(broadcaster, transport)
asyncSubscribe to events that represent a user's subscription to a channel ending.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to subscription end events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelSubscriptionEvents(broadcaster, transport)
asyncSubscribe to events that represent a user subscribing to a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to subscribe events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelSubscriptionGiftEvents(broadcaster, transport)
asyncSubscribe to events that represent a user gifting another user a subscription to a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to subscription gift events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelSubscriptionMessageEvents(broadcaster, transport)
asyncSubscribe to events that represent a user's subscription to a channel being announced.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to subscription message events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelUnbanEvents(broadcaster, transport)
asyncSubscribe to events that represent a user being unbanned in a channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to unban events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToChannelUpdateEvents(broadcaster, transport)
asyncSubscribe to events that represent a channel updating their metadata.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to update events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToDropEntitlementGrantEvents(filter, transport)
asyncSubscribe to events that represent a drop entitlement being granted.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
filter | HelixEventSubDropEntitlementGrantFilter | none | see below | |
filter.campaignId | string | none | The ID of the campaign to get events for. | |
filter.categoryId | string | none | The ID of the category/game to get events for. | |
filter.organizationId | string | none | The ID of the organization that owns the categories/games to get events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToExtensionBitsTransactionCreateEvents(clientId, transport)
asyncSubscribe to events that represent an extension Bits transaction.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
clientId | string | none | The Client ID for the extension you want to listen to Bits transactions for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToStreamOfflineEvents(broadcaster, transport)
asyncSubscribe to events that represent a stream going offline.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to online events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToStreamOnlineEvents(broadcaster, transport)
asyncSubscribe to events that represent a stream going live.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster you want to listen to online events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToUserAuthorizationGrantEvents(clientId, transport)
asyncSubscribe to events that represent a user granting authorization to an application.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
clientId | string | none | The Client ID for the application you want to listen to authorization grant events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToUserAuthorizationRevokeEvents(clientId, transport)
asyncSubscribe to events that represent a user revoking their authorization from an application.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
clientId | string | none | The Client ID for the application you want to listen to authorization revoke events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. |
subscribeToUserUpdateEvents(user, transport, withEmail)
asyncSubscribe to events that represent a user updating their account details.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user you want to listen to user update events for. | |
transport | HelixEventSubTransportOptions | none | The transport options. | |
withEmail | boolean | none | Whether to request adding the email address of the user to the notification. Only has an effect with the websocket transport. With the webhook transport, this depends solely on the previous authorization given by the user. |
updateConduit(id, shardCount)
asyncUpdates an EventSub conduit for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
id | string | none | The ID of the conduit to update. | |
shardCount | number | none | The number of shards to update for this conduit. |
updateConduitShards(conduitId, shards)
asyncUpdates shards of an EventSub conduit for the current client.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
conduitId | string | none | The ID of the conduit to update shards for. | |
shards | HelixEventSubConduitShardsOptions[] | none | List of shards to update |