Alias Users
Use alias to explicitly link two existing identifiers to the same user profile.
Most teams do not need alias() for normal sign-up or login flows. In the common case, identify() is enough.
When to call it
Use alias() when you are intentionally merging identifiers, such as:
- a legacy ID and a new ID format
- an external system identifier and your internal user ID
- two known profiles that should resolve to one person
SDK examples
When transitioning to a new ID format, alias the new ID to preserve historical data:
// after a Stripe paymentaltertable.alias(`stripe:${stripeCustomerId}`);// After HubSpot syncaltertable.alias(`hubspot:${hubspotContactId}`);
API reference
For HTTP request details, batching behavior, response shape, and error codes, see POST /alias.
Best practices
- Use aliasing sparingly and only for meaningful identity merges.
- Pick one canonical
distinct_idand alias secondary IDs to it. - Add source prefixes to alias IDs, such as
stripe:,crm:, orlegacy:. - Link aliases directly to the primary user ID, not to each other.