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. Use it to confirm which account the profile belongs to. |
nickname | string | Account-level nickname. |
faceURL | string | Account-level avatar URL. |
createTime | number | Time when the user record was created, as a Unix timestamp in milliseconds. |
globalRecvMsgOpt | MessageReceiveOption | The account's global message reception setting. See Set global message reception for the enum values. |
addFriendPermission Enterprise | AddFriendPermission | Policy applied when another user tries to add this account. See Set friend request permissions for its enum values. |
attachedInfo Enterprise | string (optional) | SDK attachment data. Parse it only according to a confirmed application contract. |
ex | string | Account-level extension string defined by the application. |
This query returns the current user's profile at the time of the call and does not trigger a profile event. Clear the previous account's profile when switching accounts. See Update your profile to learn how to receive profile updates and query again when needed.
Was this page helpful?