Releases: customerio/customerio-node
Releases · customerio/customerio-node
Release list
v5.0.1
Fixed
triggerBroadcastnow treatsdataandrecipientsas optional, matching the documented API. Calling with only a broadcast id no longer throws aTypeError, and emptydata/recipientsobjects are omitted from the request payload instead of producing a 422 (empty recipients filter is not valid) from the API — soapi.triggerBroadcast(id)sends the broadcast to its configured recipients. The parameters are positional: to passrecipientswithoutdata, usetriggerBroadcast(id, undefined, recipients). (#220)
v5.0.0
The internals of lib/request.ts have been rewritten on top of native fetch (no more https.request), and a new PipelinesClient has been added for the Pipelines API. The existing TrackClient / APIClient method surface is unchanged. Most users will not need to update any code; the breaking changes are documented below.
Breaking
CustomerIORequestError.responsetype narrowed (TypeScript only). It is now aResponseLikeinterface ({ statusCode: number; headers: Record<string, string>; ok: boolean }) instead ofhttp.IncomingMessage. The runtime properties that the SDK has always populated (statusCode, responseheaders) are preserved. If your code readserr.response.rawHeadersorerr.response.socket, or usesinstanceof http.IncomingMessage, update it to read the lowercasederr.response.headersobject instead.- The
Regionconstructor now requires a thirdpipelinesUrlargument. Code that constructsRegiondirectly with the two-argument signature (new Region(trackUrl, apiUrl)) will fail to type-check and must be updated to pass an explicit Pipelines host. Code that only consumes the exportedRegionUSandRegionEUconstants is unaffected. - The underlying request mechanism now uses
fetch. If you were handling errors based oninstanceoforError.messageyou may need to update your handlers to use nativefetcherrors.
Changed
- Outbound header names are now lowercased on the wire. This is per the WHATWG fetch spec. The Customer.io API is case-insensitive, so this only matters if you grep your own outbound HTTP logs.
- TCP keepalive is enabled by default. undici's connection pool reuses sockets across calls. Performance improves under sustained load; file-descriptor usage profile shifts slightly.
User-Agentbumps fromCustomer.io Node Client/4.xtoCustomer.io Node Client/5.0.0.- Dependency updates (#196), (#207), (#208), (#209)
- Make
getCustomersByEmailquery safe (#193) - Resolve on any 2XX status code (#192)
Added
- Automatic retries with exponential backoff and jitter, shared across
TrackClient,APIClient, andPipelinesClient. Transient network errors and the retryable status codes408,429,500,502,503,504,522,524are retried (default 3 attempts); other 4xx responses are not. ARetry-Afterheader is honored when present, and retried attempts carry anX-Retry-Countheader. Configure or disable via aretryoption on any client ({ maxRetries: 0 }to opt out). See the Retries section in the README. (#213) - New
PipelinesClientfor the Pipelines API. Providesidentify,track,page,screen,group,alias, andbatchmethods. Auto-fillsmessageId,timestamp, andcontext.libraryon every payload, and supports an optionaldefaultContextandstrictModeon the client. See the new Pipelines section in the README. (#204) Regionnow exposes apipelinesUrlfield, andRegionUS/RegionEUpoint atcdp.customer.ioandcdp-eu.customer.iorespectively. (#203)CIORequest.options()now merges custom headers supplied viadefaults.headers. Standard headers (Authorization,Content-Type,Content-Length,User-Agent) always win and cannot be clobbered. (#215)- Bun support. Bun (latest) is now part of the CI matrix alongside Node 22 / 24 / 26. Runtimes that implement standard
fetchshould work, though only Bun and Node are explicitly tested. (#197) - 307 and 308 redirects are now explicitly covered in the test suite (previously only 301/302 had direct test coverage).
- Live dogfood suite (
npm run test:live). Pre-release smoke test against a real workspace. Not part ofnpm test; gated onCIO_LIVE=1plus credentials. (#201) - v2 Batch method added to the
Trackclient (#194) - Fix
instanceofchecks for safety in cases of duplicate installs or cross-realm matching (#198)
Internal
lib/request.tsrewritten on top of nativefetchwithredirect: 'manual'andAbortSignal.timeout. The Authorization-strip rule on cross-host redirects, the timeout error message string, anderr.codeon network errors (ECONNREFUSED/ENOTFOUND/ECONNRESET) are all preserved. No runtime dependency on thehttpsmodule. (#200)nockupgraded to^14(the only version that intercepts undici'sfetch).- Omit
Content-Lengthheader on requests without a body (#199) - Convert ESLint config from CJS to ESM (#211)
- Dynamically create
lib/version.tsfile (#210)
v4.5.1
v4.5.0
Changed
- BREAKING: Drop support for Node.js versions that have reached end-of-life. Supported versions now follow the Node.js release schedule — Current, Active LTS, and Maintenance LTS only (currently Node.js 22, 24, and 26). Added an
enginesfield topackage.json. (#180) - BREAKING: Fix
triggerBroadcastAPI path by removing erroneous/apiprefix, and rename theidparameter tobroadcastIdfor clarity (#179) - Bump third-party dependencies:
@types/node,@types/sinon,ava,js-yaml,lodash,minimatch,nyc,picomatch,pretty-quick,sinon(#167, #169, #177, #178, #181)
Added
- Add
bodyproperty toSendEmailRequestWithTemplatetype definition (#172)
Fixed
- Add timeout handling for HTTP requests (#173)
v4.4.0
Added
- Add support for sending transactional in-app messages (#174)
Support sending transactional Inbox messages
Adds support for sending transactional Inbox messages
Support sending transactional SMS messages
Adds support for sending transactional SMS messages