TwurpleAuthenticationGetting dataExamplesFAQMigration

Main classes

HelixPrivilegedUser

A user you have extended privilges for, i.e. yourself.

Overview

Properties

broadcasterType

Type: HelixBroadcasterType

The type of the broadcaster.

creationDate

Type: Date

The date when the user was created, i.e. when they registered on Twitch.

description

Type: string

The description of the user.

displayName

Type: string

The display name of the user.

email

Type: ?string

The email address of the user.

id

Type: string

The ID of the user.

name

Type: string

The name of the user.

offlinePlaceholderUrl

Type: string

The URL of the offline video placeholder of the user.

profilePictureUrl

Type: string

The URL of the profile picture of the user.

type

Type:
HelixUserType

The type of a user.

Aliased type: "staff" | "admin" | "global_mod" | ""

The type of the user.

Methods

follows(broadcaster)

async

Checks whether the user is following the given broadcaster.

This requires user authentication. For broadcaster authentication, you can use isFollowedBy while switching this and the parameter.

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 check the user's follow to.

Return type: boolean

getChannelFollower(user)

async

Gets the follow data of the given user to the broadcaster, or null if the user doesn't follow the broadcaster.

This requires broadcaster authentication. For user authentication, you can use getFollowedChannel while switching this and the parameter.

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 to check the follow from.

Return type: HelixChannelFollower | null

getChannelFollowers()

async

Gets a list of users that follow the broadcaster.

getFollowedChannel(broadcaster)

async

Gets the follow data of the user to the given broadcaster, or null if the user doesn't follow the broadcaster.

This requires user authentication. For broadcaster authentication, you can use getChannelFollower while switching this and the parameter.

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 check the follow to.

Return type: HelixFollowedChannel | null

getFollowedChannels()

async

Gets a list of broadcasters the user follows.

getStream()

async

Gets the channel's stream data.

Return type: HelixStream | null

getSubscriber(user)

async

Gets the subscription data for the given user to the broadcaster, or null if the user is not subscribed.

This requires broadcaster authentication. For user authentication, you can use getSubscriptionTo while switching this and the parameter.

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 the subscription data for.

Return type: HelixSubscription | null

getSubscriptionTo(broadcaster)

async

Gets the subscription data for the user to the given broadcaster, or null if the user is not subscribed.

This requires user authentication. For broadcaster authentication, you can use getSubscriber while switching this and the parameter.

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 subscription data for.

Return type: HelixUserSubscription | null

hasSubscriber(user)

async

Checks whether the given user is subscribed to the broadcaster.

This requires broadcaster authentication. For user authentication, you can use isSubscribedTo while switching this and the parameter.

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 check the subscription for.

Return type: boolean

isFollowedBy(user)

async

Checks whether the given user is following the broadcaster.

This requires broadcaster authentication. For user authentication, you can use follows while switching this and the parameter.

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 to check the broadcaster's follow from.

Return type: boolean

isSubscribedTo(broadcaster)

async

Checks whether the user is subscribed to the given broadcaster.

This requires user authentication. For broadcaster authentication, you can use hasSubscriber while switching this and the parameter.

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 check the subscription for.

Return type: boolean

setDescription(description)

async

Changes the description of the user.

ParameterTypeRequiredDefaultDescription
descriptionstringnone

The new description.

Return type: HelixPrivilegedUser