Browse SDKs · WASM
SDKsWASM

User overview

Understand user profiles, friendships, blacklists, and online status in the WASM SDK.

Copy

The WASM SDK identifies users by userID. When implementing profile cards, friend requests, contacts, or blacklists, distinguish between an application's public user profile, the current user's friendship data, and blacklist state.

Group member lists, in-group nicknames, group roles, and member management belong to the group domain. See List group members.

User types

The WASM SDK returns different user objects for different scenarios:

TypeUse casePrimary APIs
SelfUserInfoThe signed-in user's profile, settings page, avatar, and nicknamegetSelfUserInfo(), setSelfInfo()
PublicUserItemApplication user lookup, friend candidates, and profiles for users who are not friendsgetUsersInfo()
FriendUserItemThe signed-in user's friend list, friend remarks, pinning, and relationship extension datagetFriendListPage(), getSpecifiedFriendsInfo()
BlackUserItemUsers on the signed-in user's blacklistgetBlackList(), addBlack(), removeBlack()
UserOnlineStateUser online statussubscribeUsersStatus(), getSubscribeUsersStatus()

The same userID can appear in public profiles, friend profiles, the blacklist, and group member profiles. Prefer FriendUserItem when displaying contacts, PublicUserItem when only account-level public information is needed, and GroupMemberItem when displaying group members. Conversation list and chat-page titles come from conversation data and should use ConversationItem.showName.

Feature pages

The following table maps common user-related tasks to their documentation:

TaskRecommended page
Query public profiles by userID for friend candidates or profile cardsGet user profiles
Page through, search, or query friendships by IDGet the friend list
Send or process friend applicationsSend a friend application, Get received friend applications
Update friend informationUpdate friend information
Delete a friendshipDelete a friend
View and maintain the current user's blacklistGet the blacklist
Read or update the current user's nickname, avatar, and extension dataUpdate your profile
Set account-level message reception and do-not-disturb behaviorSet global message reception
Subscribe to and read online statusSubscribe to online status
List and search group members or retrieve selected member profilesList group members

State updates

Each user-related event is listened for and merged on the page that owns that capability: