Identify Users

Users consist of a few critical pieces of information that construct a unique identity in Sentry. Each of these is optional, but one must be present for the Sentry SDK to capture the user:

Your internal identifier for the user.

The username. Typically used as a better label than the internal id.

An alternative, or addition, to the username. Sentry is aware of email addresses and can display things such as Gravatars and unlock messaging capabilities.

The user's IP address. If the user is unauthenticated, Sentry uses the IP address as a unique identifier for the user. Sentry will attempt to pull this from the HTTP request data, if available. Set to "{{auto}}" to let Sentry infer the IP address from the connection.

Additionally, you can provide arbitrary key/value pairs beyond the reserved names, and the Sentry SDK will store those with the user.

By default, we don't apply the user identification provided to the SDK via the API. Instead, we use the installation ID generated with the first use of the application. The ID doesn't contain any private or public data of your users or any public or shared data of their device.

To identify the user:

Sentry.setUser({ email: "" });

You can also clear the currently set user:

Sentry.configureScope(scope => scope.setUser(null));
You can edit this page on GitHub.