These docs are for v1.0. Click to read the latest docs for v3.0.

Identifying your users helps you find you find their sessions in the LogRocket UI.

Call LogRocket.identify on page loads to associate your own application-specific user ID with the active user. We'll refer to these user identifiers as "UIDs".

LogRocket.identify(uid);

You can use any string that uniquely identifies the user of your application, such as a database ID, an email, or a username.

If you do not provide a UID, the user will be assigned a random one and shown as "Anonymous" in the UI.

LogRocket.identify('123456') // an immutable ID from your database (preferred)
LogRocket.identify('[email protected]') // the user's email

Prefer an immutable database ID if available. Names and email addresses can be added as user data: