Identify and track users across sessions with persistent user IDs and properties
addUserInfo
function.
By using your own user ID, you can ensure that the user is tracked across sessions and can be tied back to your own user database. We
recommend using a UUID for this purpose.
logout
function. We highly
recommend doing this to prevent conflating user data or persisting it across sessions.
Property/Option | Type | Description |
---|---|---|
userId | string | Unique user ID (auto-generated and stored in a cookie by default). |
addUserInfo() | function | Add or update user properties (see below). |
auth() | function | Authenticate user using specified fields. |
userProperties | object | Any key-value pairs (e.g., email , name , plan , etc.). |
cookie | string | Stores user ID for 365 days. |
addUserInfo(userProperties)
fields:
Field | Type | Description |
---|---|---|
Any | any | You can provide any user property fields. |
Example: | ||
email | string | User’s email address. |
name | string | User’s name. |
userId | string | Your internal user ID. |
plan | string | User’s plan or segment. |