Wendung.identify() after a user logs in or whenever their identity becomes available. Every event tracked afterwards carries the provided userId and traits. Each call replaces the previous identity wholesale; traits are not merged. Events snapshot the identity at the moment step() is called, so events already queued keep the identity they were tracked with.
Throws if called before init().
Parameters
string
required
A unique, stable identifier for the user, such as a database primary key or UUID. Sent in every subsequent event payload as
identity.userId.Record<string, unknown>
Optional key-value metadata describing the user, for example
email, name, or plan. Deep-cloned at call time. Replaces any previously set traits entirely, so include every trait you want to keep. Defaults to {}.Returns
void
Examples
After login
Updating traits on plan change
Becauseidentify() replaces traits rather than merging them, spread the existing traits when updating one:
Traits are sent to your ingest endpoint as-is. Avoid including sensitive values such as passwords or payment card numbers.