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

Classes

ApiClientBadgesApiBitsApiChannelChannelApiChannelFollowChannelPlaceholderChannelSubscriptionChatApiChatBadgeListChatBadgeSetChatBadgeVersionChatEmoteChatEmoteListChattersListCheermoteListConfigErrorCreatedVideoEmoteSetListHelixApiGroupHelixBanHelixBanEventHelixBitsApiHelixBitsLeaderboardHelixBitsLeaderboardEntryHelixChannelHelixChannelApiHelixChannelEditorHelixChannelEmoteHelixChannelPointsApiHelixChannelSearchResultHelixChatApiHelixChatBadgeSetHelixChatBadgeVersionHelixCheermoteListHelixClipHelixClipApiHelixCustomRewardHelixCustomRewardRedemptionHelixEmoteHelixEmoteFromSetHelixEventSubApiHelixEventSubSubscriptionHelixExtensionsApiHelixExtensionTransactionHelixFollowHelixGameHelixGameApiHelixHypeTrainApiHelixHypeTrainContributionHelixHypeTrainEventHelixInstalledExtensionHelixInstalledExtensionListHelixModerationApiHelixModeratorHelixModeratorEventHelixPaginatedRequestHelixPaginatedRequestWithTotalHelixPaginatedScheduleSegmentRequestHelixPollHelixPollApiHelixPollChoiceHelixPredictionHelixPredictionApiHelixPredictionOutcomeHelixPredictorHelixPrivilegedUserHelixScheduleHelixScheduleApiHelixScheduleSegmentHelixSearchApiHelixStreamHelixStreamApiHelixStreamMarkerHelixStreamMarkerWithVideoHelixSubscriptionHelixSubscriptionApiHelixSubscriptionEventHelixTagHelixTagApiHelixTeamHelixTeamApiHelixTeamWithUsersHelixUserHelixUserApiHelixUserBlockHelixUserExtensionHelixUserRelationHelixUserSubscriptionHelixVideoHelixVideoApiHelixWebHooksApiHelixWebHookSubscriptionKrakenApiGroupNoSubscriptionProgramErrorPrivilegedChannelPrivilegedUserSearchApiStreamStreamApiStreamNotLiveErrorSubscriptionTeamTeamApiTeamWithUsersUnsupportedApiUserUserApiUserBlockUserChatInfoUserFollowUserSubscriptionVideoVideoApi

UserApi

The API methods that deal with users.

Overview

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

Example

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

Methods

blockUser(user, userToBlock)

async

Blocks a given user with another given user.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to block with.

userToBlockUserIdResolvablenone

The user to block.

Return type: UserBlock

followChannel(user, channel, notifications)

async

Follows a given channel with a given user.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to follow with.

channelUserIdResolvablenone

The channel to follow.

notificationsbooleannone

Whether the user will receive notifications.

Return type: UserFollow

getBlockedUsers(user, page, limit)

async

Retrieves a list of users a given user has blocked.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to retrieve the block list of.

pagenumbernone

The result page you want to retrieve.

limitnumber25

The number of results you want to retrieve.

Return type: Array<UserBlock>

getChatInfo(user)

async

Retrieves information about the user's chat appearance and privileges.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to get chat info for.

Return type: UserChatInfo

getFollowedChannel(user, channel)

async

Get follow data for a given user to a given channel.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to retrieve follow data of.

channelUserIdResolvablenone

The channel you want to retrieve follow data to.

Return type: UserFollow | null

getFollowedChannels(user, page, limit, orderBy, orderDirection)

async

Get a list of channels a given user follows.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to retrieve the follows of.

pagenumbernone

The result page you want to retrieve.

limitnumber25

The number of results you want to retrieve.

orderBystringnone

The field to order by.

orderDirection"asc" | "desc"none

The direction to order in - ascending or descending.

Return type: Array<UserFollow>

getMe()

async

Retrieves the user data of the currently authenticated user.

Return type: PrivilegedUser

getSubscriptionData(user, toChannel)

async

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

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user to retrieve the subscription data of.

toChannelUserIdResolvablenone

The channel you want to retrieve the subscription data to.

Return type: UserSubscription | null

getUser(userId)

async

Retrieves the user data for the given user ID.

ParameterTypeRequiredDefaultDescription
userIdUserIdResolvablenone

The user ID you want to look up.

Return type: User

getUserByName(userName)

async

Retrieves the user data for the given user name.

ParameterTypeRequiredDefaultDescription
userNamestringnone

The user name you want to look up.

Return type: User | null

getUserEmotes(user)

async

Retrieves the emotes a given user can use.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to get emotes for.

Return type: EmoteSetList

getUsersByNames(userNames)

async

Retrieves the user data for the given user names.

ParameterTypeRequiredDefaultDescription
userNamesArray<string>none

The user names you want to look up.

Return type: Record<string, User>

unblockUser(user, userToUnblock)

async

Unblocks a given user with another given user.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to unblock with.

userToUnblockUserIdResolvablenone

The user to unblock.

Return type: void

unfollowChannel(user, channel)

async

Unfollows a given channel with a given user.

ParameterTypeRequiredDefaultDescription
userUserIdResolvablenone

The user you want to unfollow with.

channelUserIdResolvablenone

The channel to unfollow.

Return type: void