Browse SDKs · WASM
SDKsWASM

Get your profile

Get the profile of the currently signed-in user.

Copy
const { data: currentUser } = await openimsdk.getSelfUserInfo();

Return result

After the Promise succeeds, data contains the current account's SelfUserInfo:

FieldTypeDescription
userIDstringThe signed-in user's OpenIMSDK user ID and the stable identifier for this profile snapshot.
nicknamestringAccount-level nickname.
faceURLstringAccount-level avatar URL.
createTimenumberTime when the user record was created.
globalRecvMsgOptMessageReceiveOptionThe account's global message reception setting. See Set global message reception for the enum values.
addFriendPermission EnterpriseAddFriendPermissionPolicy applied when another user tries to add this account. See Set friend request permissions for its enum values.
attachedInfo Enterprisestring (optional)SDK attachment data. Parse it only according to a confirmed application contract.
exstringAccount-level extension string defined by the application.

This query only establishes the current profile snapshot and does not trigger a profile event. Clear the old snapshot when switching accounts. See Update your profile for merging profile update events and querying again to reconcile state.