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

Classes

ApiClientBadgesApiBitsApiChannelChannelApiChannelFollowChannelPlaceholderChannelSubscriptionChatApiChatBadgeListChatBadgeSetChatBadgeVersionChatEmoteChatEmoteListChattersListCheermoteListConfigErrorCreatedVideoEmoteSetListHelixApiGroupHelixBanHelixBanEventHelixBitsApiHelixBitsLeaderboardHelixBitsLeaderboardEntryHelixChannelHelixChannelApiHelixChannelEditorHelixChannelEmoteHelixChannelPointsApiHelixChannelSearchResultHelixChatApiHelixChatBadgeSetHelixChatBadgeVersionHelixCheermoteListHelixClipHelixClipApiHelixCustomRewardHelixCustomRewardRedemptionHelixEmoteHelixEmoteFromSetHelixEventSubApiHelixEventSubSubscriptionHelixExtensionsApiHelixExtensionTransactionHelixFollowHelixGameHelixGameApiHelixHypeTrainApiHelixHypeTrainContributionHelixHypeTrainEventHelixInstalledExtensionHelixInstalledExtensionListHelixModerationApiHelixModeratorHelixModeratorEventHelixPaginatedRequestHelixPaginatedRequestWithTotalHelixPaginatedScheduleSegmentRequestHelixPollHelixPollApiHelixPollChoiceHelixPredictionHelixPredictionApiHelixPredictionOutcomeHelixPredictorHelixPrivilegedUserHelixScheduleHelixScheduleApiHelixScheduleSegmentHelixSearchApiHelixStreamHelixStreamApiHelixStreamMarkerHelixStreamMarkerWithVideoHelixSubscriptionHelixSubscriptionApiHelixSubscriptionEventHelixTagHelixTagApiHelixTeamHelixTeamApiHelixTeamWithUsersHelixUserHelixUserApiHelixUserBlockHelixUserExtensionHelixUserRelationHelixUserSubscriptionHelixVideoHelixVideoApiHelixWebHooksApiHelixWebHookSubscriptionKrakenApiGroupNoSubscriptionProgramErrorPrivilegedChannelPrivilegedUserSearchApiStreamStreamApiStreamNotLiveErrorSubscriptionTeamTeamApiTeamWithUsersUnsupportedApiUserUserApiUserBlockUserChatInfoUserFollowUserSubscriptionVideoVideoApi

ChannelApi

The API methods that deal with channels.

Overview

Can be accessed using client.kraken.channels on an ApiClient instance.

Example

const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
const channel = await api.kraken.channels.getMyChannel();

Methods

getChannel(user)

async

Retrieves the channel for the given user.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to retrieve the channel for.

Return type: Channel

getChannelEditors(channel)

async

Retrieves the list of users that have editor rights to the given channel.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel you want to retrieve the list of editors for.

Return type: Array<User>

getChannelFollowers(channel, page, limit, orderDirection)

async

Retrieves the list of followers of the given channel.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel you want to retrieve the list of followers of.

pagenumbernone

The result page you want to retrieve.

limitnumber25

The number of results you want to retrieve.

orderDirection"asc" | "desc"none

The direction to order in - ascending or descending.

Return type: Array<ChannelFollow>

getChannelSubscriptionByUser(channel, byUser)

async

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

Throws if the channel doesn't have a subscription program or the user is not subscribed to it.

This method requires access to the channel. If you only have access to the user, use UserApi#getSubscriptionData instead.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel to check the subscription to.

byUserUserIdResolvablenone

The user to check the subscription for.

Return type: ChannelSubscription | null

getChannelSubscriptionCount(channel)

async

Retrieves the total number of subscribers for the given channel.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel you want to retrieve the number of subscribers for.

Return type: number

getChannelSubscriptions(channel, page, limit, orderDirection)

async

Retrieves the list of subscribers of the given channel.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel you want to retrieve the list of subscribers of.

pagenumbernone

The result page you want to retrieve.

limitnumber25

The number of results you want to retrieve.

orderDirection"asc" | "desc"none

The direction to order in - ascending or descending.

Return type: Array<ChannelSubscription>

getChannelTeams(channel)

async

Retrieves a list of teams of the given channel.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel you want to retrieve the list of teams of.

Return type: Array<Team>

getMyChannel()

async

Gets the channel the client is logged in to.

Return type: PrivilegedChannel

resetChannelStreamKey(channel)

async

Resets the given channel's stream key.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel to reset the stream key for.

Return type: PrivilegedChannel

startChannelCommercial(channel, length)

async

Starts a commercial in the given channel.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel to start the commercial in.

length
CommercialLength

The possible lengths of a channel commercial.

Aliased type: 30 | 60 | 90 | 120 | 150 | 180

none

The length of the commercial.

Return type: void

updateChannel(channel, data)

async

Updates the given channel with the given data.

ParameterTypeRequiredDefaultDescription
channelUserIdResolvablenone

The channel you want to update.

dataChannelUpdateDatanone

The updated channel data.

Return type: void