Skip to main content
Required ACL: search Use this method to retrieve the authenticatedUserToken provided by you. For more information, see User token.

Examples

For more information about initializing the Insights client aa, see Initialize the Insights client.
JavaScript
// Set the authenticated user token
aa("setAuthenticatedUserToken", "YourUserID");

// Get the authenticated user token
aa("getAuthenticatedUserToken", {}, (err, authenticatedUserToken) => {
  if (err) {
    console.error(err);
    return;
  }

  console.log(authenticatedUserToken); // 'YourUserID'
});

Parameters

callback
(err: Error, authenticatedUserToken: string) => void
The function called with a possible error and the authenticated user token.
options
object
The options for retrieving the user token.Pass an empty object, since this argument isn’t used. The options to retrieve the authenticated user token.
⌘I