Browse SDKs · React Native
Platform
SDKsReact Native

Get current user profile

Retrieve the profile details of the authenticated account using the OpenIM React Native SDK.

Copy

Retrieve user profile details for the currently authenticated account:

const currentUser = await OpenIMSDK.getSelfUserInfo();

Return value

Resolves to a SelfUserInfo object representing the current account:

FieldTypeDescription
userIDstringOpenIM user ID identifying the current account.
nicknamestringAccount nickname.
faceURLstringAvatar image URL.
createTimenumberTimestamp when the user account was created.
globalRecvMsgOptMessageReceiveOptTypeAccount-level global message reception and do-not-disturb setting.
exstringCustom business extension string.

Invoke this method after successful authentication to populate user profile screens and avatar components. Clear any cached user state when switching accounts.