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

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.

Parameter Type Required Default Description
user UserIdResolvable none

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.

Parameter Type Required Default Description
channel UserIdResolvable none

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.

Parameter Type Required Default Description
channel UserIdResolvable none

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

page number none

The result page you want to retrieve.

limit number 25

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.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel to check the subscription to.

byUser UserIdResolvable none

The user to check the subscription for.

Return type: ChannelSubscription | null

getChannelSubscriptionCount(channel)

async

Retrieves the total number of subscribers for the given channel.

Parameter Type Required Default Description
channel UserIdResolvable none

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.

Parameter Type Required Default Description
channel UserIdResolvable none

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

page number none

The result page you want to retrieve.

limit number 25

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.

Parameter Type Required Default Description
channel UserIdResolvable none

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.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel to reset the stream key for.

Return type: PrivilegedChannel

startChannelCommercial(channel, length)

async

Starts a commercial in the given channel.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel to start the commercial in.

length CommercialLength none

The length of the commercial.

Return type: void

updateChannel(channel, data)

async

Updates the given channel with the given data.

Parameter Type Required Default Description
channel UserIdResolvable none

The channel you want to update.

data ChannelUpdateData none

The updated channel data.

Return type: void