TwurpleAuthenticationGetting dataExamplesFAQMigration

Main classes

HelixChannelApi

The Helix API methods that deal with channels.

Overview

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

Example

const api = new ApiClient({ authProvider });
const channel = await api.channels.getChannelInfoById('125328655');

Methods

addVip(broadcaster, user)

async

Adds a VIP to the broadcaster’s chat room.

ParameterTypeRequiredDefaultDescription
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 that’s granting VIP status to the user. This ID must match the user ID in the access token.

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 add as a VIP in the broadcaster’s chat room.

Return type: void

checkVipForUser(broadcaster, user)

async

Checks the VIP status of a user in a channel.

ParameterTypeRequiredDefaultDescription
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 owner of the channel to check VIP status in.

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

Return type: boolean

checkVipForUsers(broadcaster, users)

async

Checks the VIP status of a list of users in a channel.

ParameterTypeRequiredDefaultDescription
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 owner of the channel to check VIP status in.

users
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 users to check.

Return type: HelixUserRelation[]

getChannelEditors(broadcaster)

async

Gets a list of users who have editor permissions on your channel.

ParameterTypeRequiredDefaultDescription
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 to retreive the editors for.

Return type: HelixChannelEditor[]

getChannelFollowerCount(broadcaster)

async

Gets the total number of users that follow the specified broadcaster.

ParameterTypeRequiredDefaultDescription
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 get the number of followers of.

Return type: number

getChannelFollowers(broadcaster, user, pagination)

async

Gets a list of users that follow the specified broadcaster. You can also use this endpoint to see whether a specific user follows the broadcaster.

This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.

ParameterTypeRequiredDefaultDescription
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 get a list of followers for.

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

An optional user to determine if this user follows the broadcaster. If specified, the response contains this user if they follow the broadcaster. If not specified, the response contains all users that follow the broadcaster.

paginationHelixForwardPaginationnonesee below
pagination.afterstringnone

A cursor to get the following page of.

pagination.limitnumbernone

The number of results per page.

getChannelFollowersPaginated(broadcaster)

Creates a paginator for users that follow the specified broadcaster.

This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.

ParameterTypeRequiredDefaultDescription
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 whom you are getting a list of followers.

Return type: HelixPaginatedRequestWithTotal<HelixChannelFollowerData, HelixChannelFollower>

getChannelInfoById(user)

async

Gets the channel data for the given user.

ParameterTypeRequiredDefaultDescription
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 get channel info for.

Return type: HelixChannel | null

getChannelInfoByIdBatched(user)

async

Gets the channel data for the given user, batching multiple calls into fewer requests as the API allows.

ParameterTypeRequiredDefaultDescription
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 get channel info for.

Return type: HelixChannel | null

getChannelInfoByIds(users)

async

Gets the channel data for the given users.

ParameterTypeRequiredDefaultDescription
users
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 users you want to get channel info for.

Return type: HelixChannel[]

getFollowedChannels(user, broadcaster, pagination)

async

Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether the user follows a specific broadcaster.

ParameterTypeRequiredDefaultDescription
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 that's getting a list of followed channels. This ID must match the user ID in the access token.

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

An optional broadcaster to determine if the user follows this broadcaster. If specified, the response contains this broadcaster if the user follows them. If not specified, the response contains all broadcasters that the user follows.

paginationHelixForwardPaginationnonenone

getFollowedChannelsPaginated(user, broadcaster)

Creates a paginator for broadcasters that the specified user follows.

ParameterTypeRequiredDefaultDescription
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 that's getting a list of followed channels. The token of this user will be used to get the list of followed channels.

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

An optional broadcaster to determine if the user follows this broadcaster. If specified, the response contains this broadcaster if the user follows them. If not specified, the response contains all broadcasters that the user follows.

Return type: HelixPaginatedRequestWithTotal<HelixFollowedChannelData, HelixFollowedChannel>

getVips(broadcaster, pagination)

async

Gets a list of VIPs in a channel.

ParameterTypeRequiredDefaultDescription
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 owner of the channel to get VIPs for.

paginationHelixForwardPaginationnonesee below
pagination.afterstringnone

A cursor to get the following page of.

pagination.limitnumbernone

The number of results per page.

getVipsPaginated(broadcaster)

Creates a paginator for VIPs in a channel.

ParameterTypeRequiredDefaultDescription
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 owner of the channel to get VIPs for.

Return type: HelixPaginatedRequest<HelixUserRelationData, HelixUserRelation>

removeVip(broadcaster, user)

async

Removes a VIP from the broadcaster’s chat room.

ParameterTypeRequiredDefaultDescription
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 that’s removing VIP status from the user. This ID must match the user ID in the access token.

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 remove as a VIP from the broadcaster’s chat room.

Return type: void

startChannelCommercial(broadcaster, length)

async

Starts a commercial on a channel.

ParameterTypeRequiredDefaultDescription
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 on whose channel the commercial is started.

length
CommercialLength

The possible lengths of a channel commercial.

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

none

The length of the commercial, in seconds.

Return type: void

updateChannelInfo(user, data)

async

Updates the given user's channel data.

ParameterTypeRequiredDefaultDescription
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 update channel info for.

dataHelixChannelUpdatenone

The channel info to set.

Return type: void