SDKsWASM
Get your profile
Get the profile of the currently signed-in user.
const { data: currentUser } = await openimsdk.getSelfUserInfo();Return result
After the Promise succeeds, data contains the current account's SelfUserInfo:
| Field | Type | Description |
|---|---|---|
userID | string | The signed-in user's OpenIMSDK user ID and the stable identifier for this profile snapshot. |
nickname | string | Account-level nickname. |
faceURL | string | Account-level avatar URL. |
createTime | number | Time when the user record was created. |
globalRecvMsgOpt | MessageReceiveOptType | The account's global message reception setting. See Set global message reception for the enum values. |
addFriendPermission | AddFriendPermission | Permission policy applied when another user tries to add this account. |
ex | string | Account-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.
Was this page helpful?