Skip to main content
Required ACL: search Use this method to automatically send the authenticatedUserToken with every event. For more information, see User token.

Examples

For more on setting up the JavaScript Insights client aa, see Initialize the Insights client.
JavaScript
When a user logs in, set the authenticated user token. Use the user ID from your system.
JavaScript
Algolia now sends both the anonymous and authenticated tokens with each event. This keeps data from before users signed in. When users log out, you can unset the authenticated token by passing undefined.
JavaScript

Parameters

string | undefined
required
Pseudonymous identifier for authenticated users.
Don’t include personally identifiable information in user tokens.
See also: User token
Last modified on September 16, 2026