identify() method registers the current user with Usertour. Call this method once on each page load where a user is signed in.
When you provide attributes, they will be merged with the user’s existing attributes in Usertour. Attributes not included in the call will retain their current values.
Note: Only theIf the user has any active flows, they will be displayed. New flows may start if the user matches their start conditions.userIdparameter is required. We recommend includingname,signed_up_atattributes to help identify users in Usertour and support flow conditions. Do not send sensitive data such as passwords.
Parameters
The unique identifier for the user in your system.
User attributes to update. See Attributes for details. These attributes can be used in flow content and conditions to personalize the user experience.
An identity token: a JWT minted by your backend, HS256-signed with your
environment’s signing secret, whose
sub claim must equal userId. Proves
the identity claim so nobody can impersonate your users with your public
environment token. Required once Require identity verification is
enabled for the environment. See Identity Verification.Returns
APromise that resolves when the identification is complete.
Examples
Basic Usage
With Recommended Attributes
With Identity Verification
Notes
- Call this method once per page load for authenticated users
- The
userIdmust be unique within your system - Attributes are merged with existing values
- Active flows will be displayed immediately
- New flows may start based on conditions
- With identity verification enforced, calls without a valid
options.tokenare rejected — see Identity Verification