Skip to content

Identifying users

Identifying users is a helpful way to add context to a bug report. It allows you to see exactly who reported the issue, which can be helpful for debugging or for reaching out to that user for more information.

You can use the identify API to link a bug report to a specific user in your application. The identified user's details will appear in the captured bug report.

How to identify

Call the identify method at any time after initialising the Capture widget to associate the current session with a user.

js
Capture.identify({
  identifier: "some-unique-id",
  name: "John Smith",
  email: "john.smith@mycompany.com",
  avatarUrl: "https://cdn.myapp.com/images/image.jpeg",
});

Any reports created after calling identify will be linked to that user.

To remove a user's identity, such as on log out, pass null to Capture.identify. Future reports will no longer be associated with that user.

js
Capture.identify(null);

Identity fields

  • identifier (required) – A unique value that identifies this user within your application. This could be a user ID, email address, or any other consistent identifier. It should remain the same for the same user across page loads. This allows Capture to group all reports from a single user.
  • name (optional) – The user's name. Displayed in bug reports to help identify the reporter.
  • email (optional) – Included in the report to make it easier to reach out to the user if needed.
  • avatarUrl (optional) – If provided, this image will appear in the Capture UI and bug reports.

Updating user info

If a user’s information, such as their name or avatar, changes in your system, it will be updated in Capture the next time that user creates a bug report, as long as the identifier remains the same.