Node SDK
alias
Migrate events from one known ID to another known ID.
Ferno reassigns all previous events for previousId to userId. Use this only for known-ID migration or merging duplicate known accounts:
| Field | Required | Type | Description |
|---|---|---|---|
userId | true | string | The new canonical user ID to associate with the previous ID. |
previousId | true | string | The prior user or anonymous ID whose events should be reassigned. |
context | false | object | Additional context about the identity migration. |
timestamp | false | string | Date | The time the alias operation occurred. |
integrations | false | object | Per-call destination controls that enable or disable specific integrations. |
messageId | false | string | An application-provided identifier used to deduplicate the alias event. |
callback | false | function | Runs after dispatch processing. |
Most applications do not need to call alias; identify is sufficient for
anonymous users, sign-in, session restoration, and account switching.
- Legacy ID to canonical ID migration.
- Duplicate customer-record merge.
- Account-model consolidation.
- Database import or identity repair.
Do not call alias after ordinary authentication or when a user switches accounts. Call identify for the authenticated account instead. Alias would incorrectly merge separate users.
Optional fields are context, timestamp, integrations, and messageId. The callback is the second argument.