Skip to content

Function: getUserProfile() ​

ts
function getUserProfile(): Promise<IUserProfile>;

Reads the profile of the signed-in user. The access token is refreshed automatically when it has expired or Zalo reports it invalid.

Returns ​

Promise<IUserProfile>

Throws ​

NOT_AUTHENTICATED when there is no session, a numeric Zalo code, INVALID_RESPONSE when the profile cannot be read, or NOT_CONFIGURED when the Zalo App ID is missing.

Example ​

ts
const { id, name, picture } = await getUserProfile();

Released under the MIT License.