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

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.

ParameterTypeDescription
userUserIdResolvable

The user you want to block with.

userToBlockUserIdResolvable

The user to block.

Return type: UserBlock

followChannel(user, channel, notifications)

async

Follows a given channel with a given user.

ParameterTypeDescription
userUserIdResolvable

The user you want to follow with.

channelUserIdResolvable

The channel to follow.

notificationsboolean

Whether the user will receive notifications.

Return type: UserFollow

getBlockedUsers(user, page, limit)

async

Retrieves a list of users a given user has blocked.

ParameterTypeDescription
userUserIdResolvable

The user you want to retrieve the block list of.

pagenumber

The result page you want to retrieve.

limitnumber

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.

ParameterTypeDescription
userUserIdResolvable

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.

ParameterTypeDescription
userUserIdResolvable

The user you want to retrieve follow data of.

channelUserIdResolvable

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.

ParameterTypeDescription
userUserIdResolvable

The user you want to retrieve the follows of.

pagenumber

The result page you want to retrieve.

limitnumber

The number of results you want to retrieve.

orderBystring

The field to order by.

orderDirection"asc" | "desc"

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.

ParameterTypeDescription
userUserIdResolvable

The user to retrieve the subscription data of.

toChannelUserIdResolvable

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.

ParameterTypeDescription
userIdUserIdResolvable

The user ID you want to look up.

Return type: User

getUserByName(userName)

async

Retrieves the user data for the given user name.

ParameterTypeDescription
userNamestring

The user name you want to look up.

Return type: User | null

getUserEmotes(user)

async

Retrieves the emotes a given user can use.

ParameterTypeDescription
userUserIdResolvable

The user you want to get emotes for.

Return type: EmoteSetList

getUsersByNames(userNames)

async

Retrieves the user data for the given user names.

ParameterTypeDescription
userNamesArray<string>

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.

ParameterTypeDescription
userUserIdResolvable

The user you want to unblock with.

userToUnblockUserIdResolvable

The user to unblock.

Return type: void

unfollowChannel(user, channel)

async

Unfollows a given channel with a given user.

ParameterTypeDescription
userUserIdResolvable

The user you want to unfollow with.

channelUserIdResolvable

The channel to unfollow.

Return type: void