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.
globalRecvMsgOptMessageReceiveOptTypeThe account's global message reception setting. See Set global message reception for the enum values.
addFriendPermissionAddFriendPermissionPermission policy applied when another user tries to add this account.
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.