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)
asyncCreates a new follow from a user to another user.
Parameter | Type | Description |
---|---|---|
fromUser | UserIdResolvable | The user to create the follow for. |
toUser | UserIdResolvable | The user to follow. |
allowNotifications | boolean | Whether email or push notifications are allowed to be created. The user |
deleteFollow(fromUser, toUser)
asyncRemoves a follow from a user to another user.
Parameter | Type | Description |
---|---|---|
fromUser | UserIdResolvable | The user to remove the follow for. |
toUser | UserIdResolvable | The user to unfollow. |
getActiveExtensions(user)
asyncGet a list of all installed extensions for the given user.
Parameter | Type | Description |
---|---|---|
user | UserIdResolvable | The user to get the installed extensions for. If not given, get the installed extensions for the authenticated user. |
getFollowFromUserToBroadcaster(user, broadcaster)
asyncRetrieves the follow relation bewteen a given user and a given broadcaster.
Parameter | Type | Description |
---|---|---|
user | UserIdResolvable | The user to retrieve the follow relation for. |
broadcaster | UserIdResolvable | The broadcaster to retrieve the follow relation for. |
getFollows(filter)
asyncRetrieves a list of follow relations.
Parameter | Type | Description |
---|---|---|
filter | HelixFollowFilter | Several filtering and pagination parameters. See the HelixFollowFilter documentation. |
getFollowsPaginated(filter)
Creates a paginator for follow relations.
Parameter | Type | Description |
---|---|---|
filter | HelixFollowFilter | Several filtering and pagination parameters. See the HelixFollowFilter documentation. |
getMe(withEmail)
asyncRetrieves the user data of the currently authenticated user.
Parameter | Type | Description |
---|---|---|
withEmail | boolean | Whether you need the user's email address. |
getMyExtensions()
asyncGet a list of all extensions for the authenticated user.
getUserById(userId)
asyncRetrieves the user data for the given user ID.
Parameter | Type | Description |
---|---|---|
userId | UserIdResolvable | The user ID you want to look up. |
getUserByName(userName)
asyncRetrieves the user data for the given user name.
Parameter | Type | Description |
---|---|---|
userName | UserNameResolvable | The user name you want to look up. |
getUsersByIds(userIds)
asyncRetrieves the user data for the given list of user IDs.
Parameter | Type | Description |
---|---|---|
userIds | Array<UserIdResolvable> | The user IDs you want to look up. |
getUsersByNames(userNames)
asyncRetrieves the user data for the given list of user names.
Parameter | Type | Description |
---|---|---|
userNames | Array<UserNameResolvable> | The user names you want to look up. |
updateMyActiveExtensions(data)
asyncUpdates the installed extensions for the authenticated user.
Parameter | Type | Description |
---|---|---|
data | HelixUserExtensionUpdatePayload | The extension installation payload. The format is shown on the Twitch documentation. Don't use the "data" wrapper though. |
updateUser(data)
asyncUpdates the currently authenticated user's data.
Parameter | Type | Description |
---|---|---|
data | HelixUserUpdate | The data to update. |
userFollowsBroadcaster(user, broadcaster)
asyncChecks whether the given user follows the given broadcaster.
Parameter | Type | Description |
---|---|---|
user | UserIdResolvable | The user to check the follow for. |
broadcaster | UserIdResolvable | The broadcaster to check the follow for. |