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.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to block with.

userToBlock UserIdResolvable none

The user to block.

Return type: UserBlock

followChannel(user, channel, notifications)

async

Follows a given channel with a given user.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to follow with.

channel UserIdResolvable none

The channel to follow.

notifications boolean none

Whether the user will receive notifications.

Return type: UserFollow

getBlockedUsers(user, page, limit)

async

Retrieves a list of users a given user has blocked.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to retrieve the block list of.

page number none

The result page you want to retrieve.

limit number 25

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.

Parameter Type Required Default Description
user UserIdResolvable none

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.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to retrieve follow data of.

channel UserIdResolvable none

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.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to retrieve the follows of.

page number none

The result page you want to retrieve.

limit number 25

The number of results you want to retrieve.

orderBy string none

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.

Parameter Type Required Default Description
user UserIdResolvable none

The user to retrieve the subscription data of.

toChannel UserIdResolvable none

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.

Parameter Type Required Default Description
userId UserIdResolvable none

The user ID you want to look up.

Return type: User

getUserByName(userName)

async

Retrieves the user data for the given user name.

Parameter Type Required Default Description
userName string none

The user name you want to look up.

Return type: User | null

getUserEmotes(user)

async

Retrieves the emotes a given user can use.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to get emotes for.

Return type: EmoteSetList

getUsersByNames(userNames)

async

Retrieves the user data for the given user names.

Parameter Type Required Default Description
userNames Array<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.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to unblock with.

userToUnblock UserIdResolvable none

The user to unblock.

Return type: void

unfollowChannel(user, channel)

async

Unfollows a given channel with a given user.

Parameter Type Required Default Description
user UserIdResolvable none

The user you want to unfollow with.

channel UserIdResolvable none

The channel to unfollow.

Return type: void