Skip to main content
Request access to the user’s basic profile information.

Parameters

PropertyTypeRequiredDescription
successFunctionNoCallback with user info
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Success Callback

PropertyTypeDescription
responseStringJSON string with user info

Code Example

my.getOpenUserInfo({
  success: (res) => {
    const userInfo = JSON.parse(res.response).response;
    console.log('Nickname:', userInfo.nickName);
    console.log('Avatar:', userInfo.avatar);
  },
  fail: (err) => {
    console.error('Failed to get user info:', err);
  }
});
User must grant permission for their profile information. Always handle the case where the user denies access.