getUser

Deprecation Notice

This SDK is deprecated in favor of the Core and UI JS SDKs. See Migrating to the latest SDKs to use the latest Core and UI SDKs.

Support for the Legacy JS SDK ends on 28 February, 2021.

reach5('getUser', {
  accessToken: string,
  callback: function,
  // Optional arguments
  fields: string,
})

About this command

Retrieve user’s profile.

Examples

reach5('getUser', {
  accessToken: 'eyJ0eXAiOiJKV1QiL...',
  fields: 'id,givenName,familyName,email,birthdate'
}, function(err, user) {
  if (err) {
    // Handle error
    return;
  }
  // do something with user
});

Parameters

accessToken string

User’s access token.

fields string

User’s fields to retrieve in the response. Defaults to id,name,email.

callback string

Event callback that was used with on.