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

HelixUserApi

The Helix API methods that deal with users.

Overview

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

Example

const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
const user = await api.helix.users.getUserById('125328655');

Methods

createFollow(fromUser, toUser, allowNotifications)

async

Creates a new follow from a user to another user.

ParameterTypeDescription
fromUserUserIdResolvable

The user to create the follow for.

toUserUserIdResolvable

The user to follow.

allowNotificationsboolean

Whether email or push notifications are allowed to be created.

The user fromUser still needs to have this enabled in their settings as well.

Return type: void

deleteFollow(fromUser, toUser)

async

Removes a follow from a user to another user.

ParameterTypeDescription
fromUserUserIdResolvable

The user to remove the follow for.

toUserUserIdResolvable

The user to unfollow.

Return type: void

getActiveExtensions(user)

async

Get a list of all installed extensions for the given user.

ParameterTypeDescription
userUserIdResolvable

The user to get the installed extensions for.

If not given, get the installed extensions for the authenticated user.

getFollowFromUserToBroadcaster(user, broadcaster)

async

Retrieves the follow relation bewteen a given user and a given broadcaster.

ParameterTypeDescription
userUserIdResolvable

The user to retrieve the follow relation for.

broadcasterUserIdResolvable

The broadcaster to retrieve the follow relation for.

Return type: HelixFollow | null

getFollows(filter)

async

Retrieves a list of follow relations.

ParameterTypeDescription
filterHelixFollowFilter

Several filtering and pagination parameters. See the HelixFollowFilter documentation.

getFollowsPaginated(filter)

Creates a paginator for follow relations.

ParameterTypeDescription
filterHelixFollowFilter

Several filtering and pagination parameters. See the HelixFollowFilter documentation.

Return type: HelixPaginatedRequestWithTotal<HelixFollowData, HelixFollow>

getMe(withEmail)

async

Retrieves the user data of the currently authenticated user.

ParameterTypeDescription
withEmailboolean

Whether you need the user's email address.

Return type: HelixPrivilegedUser

getMyExtensions()

async

Get a list of all extensions for the authenticated user.

Return type: Array<HelixUserExtension>

getUserById(userId)

async

Retrieves the user data for the given user ID.

ParameterTypeDescription
userIdUserIdResolvable

The user ID you want to look up.

Return type: HelixUser | null

getUserByName(userName)

async

Retrieves the user data for the given user name.

ParameterTypeDescription
userNameUserNameResolvable

The user name you want to look up.

Return type: HelixUser | null

getUsersByIds(userIds)

async

Retrieves the user data for the given list of user IDs.

ParameterTypeDescription
userIdsArray<UserIdResolvable>

The user IDs you want to look up.

Return type: Array<HelixUser>

getUsersByNames(userNames)

async

Retrieves the user data for the given list of user names.

ParameterTypeDescription
userNamesArray<UserNameResolvable>

The user names you want to look up.

Return type: Array<HelixUser>

updateMyActiveExtensions(data)

async

Updates the installed extensions for the authenticated user.

ParameterTypeDescription
dataHelixUserExtensionUpdatePayload

The extension installation payload.

The format is shown on the Twitch documentation. Don't use the "data" wrapper though.

updateUser(data)

async

Updates the currently authenticated user's data.

ParameterTypeDescription
dataHelixUserUpdate

The data to update.

Return type: HelixPrivilegedUser

userFollowsBroadcaster(user, broadcaster)

async

Checks whether the given user follows the given broadcaster.

ParameterTypeDescription
userUserIdResolvable

The user to check the follow for.

broadcasterUserIdResolvable

The broadcaster to check the follow for.

Return type: boolean