Signature
Your application’s unique id for this user. Use an opaque identifier (not an email or other
personal data), and use the same id across sessions and devices; claims, subscription
events, and measurement join on it.
Optional attributes set in the same call, equivalent to a following
setUserAttributes().void. Fire-and-forget: the id is applied and persisted locally right away, and the
backend link (previous id → new id) is sent asynchronously.
Example
Behavior
- The new id is persisted in
localStorageand used for all subsequent SDK activity. - Calling with the same id again is a no-op, so it is safe to call on every page load.
- Identify as early as you reliably can, ideally before the first offer presentation, so activity binds to the stable id rather than the anonymous one.
- When switching to a different user (account switch), call
reset()first, thenidentify()the new user.
getCurrentUserId()
identify(), the auto-generated anonymous UUID otherwise, or null
before configure().
getAppAccountId()
app_account_id on
subscription webhooks. Currently resolves to
the same value as getCurrentUserId().
Related
- User Management quickstart: the full identity model
setUserAttributes(): update attributes laterreset(): clear identity on logout