The customerio-node package provides an official Node.js client for interacting with the Customer.io Journeys REST API. It allows developers to perform core actions such as identifying customers, tracking events, deleting profiles, and sending transactional emails, SMS, push, and Inbox messages. The current stable version is 4.3.0, with regular patch and minor releases addressing bug fixes and adding new transactional messaging capabilities. Major versions, like v4.0.0, introduce breaking changes, primarily for API consistency. While this client is robust for the Journeys API, for new integrations, Customer.io generally recommends using their Data Pipelines JavaScript client (`@customerio/cdp-analytics-js`), which provides a unified interface across various data sources. This library is designed for Node.js environments and warns against use in alternative runtimes due to potential API differences.
npm install customerio-nodeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Customer.io `TrackClient` and identify a customer with their basic attributes, using environment variables for credentials.
Update your transactional email payloads to use `body_amp` instead of `amp_body`.
Ensure the `id` passed to `cio.identify()` for updates is prefixed with `cio_` (e.g., `cio.identify(`cio_${customer.cio_id}`, { email: 'new@example.com' });`).For non-Node.js runtimes, consider using Customer.io's Track and App APIs directly with your runtime's built-in HTTP client or the React Native SDK if applicable.
If you need to suppress a person, use `cio.suppress(id)` instead of `cio.destroy(id)` to prevent them from being re-added and to comply with privacy regulations.
Always explicitly set the `region` option in the `TrackClient` constructor to `RegionUS` or `RegionEU` to match your Customer.io account's configured region: `new TrackClient(siteId, apiKey, { region: RegionEU });`This issue was fixed in `v3.5.0` of the `customerio-node` client. Ensure you are on version `3.5.0` or higher. If the problem persists, double-check the email format and other query parameters.
When updating, the `id` argument for `cio.identify()` must be formatted as `cio_<cio_id_value>`.
No dependency data recorded yet.