twitcheasy-twitch-bottwitch-authtwitch-auth-tmitwitch-chat-clienttwitch-eventsubtwitch-pubsub-clienttwitch-webhooks
Welcome

Classes

ApiClientBadgesApiBitsApiChannelChannelApiChannelFollowChannelPlaceholderChannelSubscriptionChatApiChatBadgeListChatBadgeSetChatBadgeVersionChatEmoteChatEmoteListChattersListCheermoteListConfigErrorCreatedVideoEmoteSetListHelixApiGroupHelixBanHelixBanEventHelixBitsApiHelixBitsLeaderboardHelixBitsLeaderboardEntryHelixChannelHelixChannelApiHelixChannelEditorHelixChannelEmoteHelixChannelPointsApiHelixChannelSearchResultHelixChatApiHelixChatBadgeSetHelixChatBadgeVersionHelixCheermoteListHelixClipHelixClipApiHelixCustomRewardHelixCustomRewardRedemptionHelixEmoteHelixEmoteFromSetHelixEventSubApiHelixEventSubSubscriptionHelixExtensionsApiHelixExtensionTransactionHelixFollowHelixGameHelixGameApiHelixHypeTrainApiHelixHypeTrainContributionHelixHypeTrainEventHelixInstalledExtensionHelixInstalledExtensionListHelixModerationApiHelixModeratorHelixModeratorEventHelixPaginatedRequestHelixPaginatedRequestWithTotalHelixPaginatedScheduleSegmentRequestHelixPollHelixPollApiHelixPollChoiceHelixPredictionHelixPredictionApiHelixPredictionOutcomeHelixPredictorHelixPrivilegedUserHelixScheduleHelixScheduleApiHelixScheduleSegmentHelixSearchApiHelixStreamHelixStreamApiHelixStreamMarkerHelixStreamMarkerWithVideoHelixSubscriptionHelixSubscriptionApiHelixSubscriptionEventHelixTagHelixTagApiHelixTeamHelixTeamApiHelixTeamWithUsersHelixUserHelixUserApiHelixUserBlockHelixUserExtensionHelixUserRelationHelixUserSubscriptionHelixVideoHelixVideoApiHelixWebHooksApiHelixWebHookSubscriptionKrakenApiGroupNoSubscriptionProgramErrorPrivilegedChannelPrivilegedUserSearchApiStreamStreamApiStreamNotLiveErrorSubscriptionTeamTeamApiTeamWithUsersUnsupportedApiUserUserApiUserBlockUserChatInfoUserFollowUserSubscriptionVideoVideoApi

HelixSubscriptionApi

The Helix API methods that deal with subscriptions.

Overview

Can be accessed using client.helix.subscriptions on an ApiClient instance.

Example

const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
const subscription = await api.helix.subscriptions.getSubscriptionForUser('61369223', '125328655');

Methods

checkUserSubscription(user, broadcaster)

async

Checks if a given user is subscribed to a given broadcaster. Returns null if not subscribed.

This checks with the authorization of a user. If you only have the authorization of a broadcaster, check HelixSubscriptionApi#getSubscriptionForUser.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The broadcaster to check the user's subscription for.

broadcasterUserIdResolvablenone

The user to check.

Return type: HelixUserSubscription | null

getSubscriptionEventById(id)

async

Retrieves a single subscription event by ID.

ParameterTypeRequiredDefaultDescription
idstringnone

The event ID.

Return type: HelixSubscriptionEvent | null

getSubscriptionEventsForBroadcaster(broadcaster)

async

Retrieves the most recent subscription events for a given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcasterUserIdResolvablenone

The broadcaster to retrieve subscription events for.

getSubscriptionEventsForBroadcasterPaginated(broadcaster)

Creates a paginator for the recent subscription events for a given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcasterUserIdResolvablenone

The broadcaster to retrieve subscription events for.

Return type: HelixPaginatedRequest<HelixSubscriptionEventData, HelixSubscriptionEvent>

getSubscriptionForUser(broadcaster, user)

async

Retrieves the subscription data for a given user to a given broadcaster.

This checks with the authorization of a broadcaster. If you only have the authorization of a user, check HelixSubscriptionApi#checkUserSubscription.

ParameterTypeRequiredDefaultDescription
broadcasterUserIdResolvablenone

The broadcaster to check.

userUserIdResolvablenone

The user to check.

Return type: HelixSubscription | null

getSubscriptions(broadcaster)

async

Retrieves a list of all subscriptions to a given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcasterUserIdResolvablenone

The broadcaster to list subscriptions to.

getSubscriptionsForUsers(broadcaster, users)

async

Retrieves the subset of the given user list that is subscribed to the given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcasterUserIdResolvablenone

The broadcaster to find subscriptions to.

usersArray<UserIdResolvable>none

The users that should be checked for subscriptions.

Return type: Array<HelixSubscription>

getSubscriptionsPaginated(broadcaster)

Creates a paginator for all subscriptions to a given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcasterUserIdResolvablenone

The broadcaster to list subscriptions to.

Return type: HelixPaginatedRequestWithTotal<HelixSubscriptionData, HelixSubscription>