Appearance
Identifying users
Use the identify API to link bug reports to specific users in your application. The user's details will appear in the Capture dashboard and in any reports published to your integrations.
How to identify users
Initialise the Web SDK with the optional identity option to link a session to a user.
html
<script>
window.captureOptions = {
captureKey: "YOUR_CAPTURE_KEY",
identity: {
identifier: "user-12345",
name: "John Smith"
}
}Or call the identify method from anywhere within your code to associate the current session with a user:
js
Capture.identify({
identifier: "user-12345",
name: "John Smith",
});Any captures created after calling identify will be linked to that user.
Removing user identity
To clear a user's identity (for example, when they log out), pass null to Capture.identify:
js
Capture.identify(null);Identity fields
| Field | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | A unique, stable value for this user in your application, such as a user ID. Used to attribute Captures from multiple sessions to the same user. |
name | string | No | The user's display name, shown when viewing a Capture. |
email | string | No | Included in bug reports so your team can reach out to the user if needed. |
Next steps
Want to include additional context beyond user identity? Learn how to add custom context to capture application state, feature flags, or other metadata specific to your app.