Node SDK
track
Record trusted server-side behavior and outcomes.
Signature#
params contains:
| Field | Required | Type | Description |
|---|---|---|---|
event | true | string | Event name. |
userId or anonymousId | true | string | At least one identity is required. |
properties | false | object | Behavior or outcome data. |
context | false | object | Extra context. |
timestamp | false | string | Date | Event time. |
integrations | false | object | Destination controls. |
messageId | false | string | Deduplication ID. |
callback | false | function | Callback after dispatch processing. |
Use Node track for authoritative backend outcomes such as payment success, subscription activation, report generation, or account changes. Do not send raw request bodies, form values, secrets, payment credentials, or provider responses.
The callback is optional and receives the dispatch context. messageId can be supplied when the application controls deduplication; otherwise the SDK generates one.