Skip to content

Latest commit

 

History

History
368 lines (213 loc) · 17.5 KB

File metadata and controls

368 lines (213 loc) · 17.5 KB

Changelog

All notable changes to this project will be documented in this file.

[5.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.response type narrowed (TypeScript only). It is now a ResponseLike interface ({ statusCode: number; headers: Record<string, string>; ok: boolean }) instead of http.IncomingMessage. The runtime properties that the SDK has always populated (statusCode, response headers) are preserved. If your code reads err.response.rawHeaders or err.response.socket, or uses instanceof http.IncomingMessage, update it to read the lowercased err.response.headers object instead.
  • The Region constructor now requires a third pipelinesUrl argument. Code that constructs Region directly 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 exported RegionUS and RegionEU constants is unaffected.
  • The underlying request mechanism now uses fetch. If you were handling errors based on instanceof or Error.message you may need to update your handlers to use native fetch errors.

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-Agent bumps from Customer.io Node Client/4.x to Customer.io Node Client/5.0.0.
  • Dependency updates (#196), (#207), (#208), (#209)
  • Make getCustomersByEmail query safe (#193)
  • Resolve on any 2XX status code (#192)

Added

  • Automatic retries with exponential backoff and jitter, shared across TrackClient, APIClient, and PipelinesClient. Transient network errors and the retryable status codes 408, 429, 500, 502, 503, 504, 522, 524 are retried (default 3 attempts); other 4xx responses are not. A Retry-After header is honored when present, and retried attempts carry an X-Retry-Count header. Configure or disable via a retry option on any client ({ maxRetries: 0 } to opt out). See the Retries section in the README. (#213)
  • New PipelinesClient for the Pipelines API. Provides identify, track, page, screen, group, alias, and batch methods. Auto-fills messageId, timestamp, and context.library on every payload, and supports an optional defaultContext and strictMode on the client. See the new Pipelines section in the README. (#204)
  • Region now exposes a pipelinesUrl field, and RegionUS / RegionEU point at cdp.customer.io and cdp-eu.customer.io respectively. (#203)
  • CIORequest.options() now merges custom headers supplied via defaults.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 fetch should 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 of npm test; gated on CIO_LIVE=1 plus credentials. (#201)
  • v2 Batch method added to the Track client (#194)
  • Fix instanceof checks for safety in cases of duplicate installs or cross-realm matching (#198)

Internal

  • lib/request.ts rewritten on top of native fetch with redirect: 'manual' and AbortSignal.timeout. The Authorization-strip rule on cross-host redirects, the timeout error message string, and err.code on network errors (ECONNREFUSED / ENOTFOUND / ECONNRESET) are all preserved. No runtime dependency on the https module. (#200)
  • nock upgraded to ^14 (the only version that intercepts undici's fetch).
  • Omit Content-Length header on requests without a body (#199)
  • Convert ESLint config from CJS to ESM (#211)
  • Dynamically create lib/version.ts file (#210)

[4.5.1]

Fixed

  • Fix redirect handler shadowing request body with response body (#185)
  • Strip Authorization header on non-customer.io redirects (#186)
  • URL-encode path parameters in APIClient (#187)

[4.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 engines field to package.json. (#180)
  • BREAKING: Fix triggerBroadcast API path by removing erroneous /api prefix, and rename the id parameter to broadcastId for 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 body property to SendEmailRequestWithTemplate type definition (#172)

Fixed

  • Add timeout handling for HTTP requests (#173)

[4.4.0]

Added

  • Add support for sending transactional in-app messages (#174)

[4.3.0]

Added

  • Add support for sending transactional Inbox messages (#170)

[4.2.0]

Added

  • Add support for sending transactional SMS messages (#164)

[4.1.1]

Fixed

  • Explicitly initialize a variable to avoid build errors (#143)

[4.1.0]

Added

[4.0.0]

Changed

  • Updated transactional email request parameter amp_body to body_amp for consistency across APIs (#137)

[3.5.1]

Fixed

  • Handle redirect responses from the track and app apis (#135)

[3.5.0]

Added

  • Added getAttributes method (#129)

Fixed

  • Pass query parameters for getCustomersByEmail to prevent 400 responses from Customer.io (#132)

[3.4.1]

Added

  • Added disable_css_preprocessing and language optional fields (#127)

[3.4.0]

Added

  • Add export methods to the api class (#120)
  • Add customer lookup by email method to the api class (#124)
  • Add unsuppress method to the track class (#123)

Changed

  • Update minimatch (dev only) (#121)

[3.3.6]

Fixed

  • Republish to npm since 3.3.5 didn't include the correct changes (Context)

[3.3.5]

Fixed

  • Add extra device attributes to attributes object in addDevice (#115)

[3.3.4]

Fixed

  • Re-publish to npm since 3.3.3 didn't include the correct changes (Context)

[3.3.3]

Fixed

  • Use the track api url instead of the app api url for mergeCustomers (#114)

[3.3.2]

Changed

  • Add more files to the npm ignore file (#109)
  • Attempt to re-publish to get a proper build before publishing

[3.3.1]

Changed

  • Export CustomerIORequestError in Typescript types (#108)

[3.3.0]

Added

  • Added support for use with gitpod (#101)
  • Added support for invite-type anonymous event tracking (#106, #107)

Updated

  • Export more types from request.ts (#102)

Fixed

  • Fix instances of customerio-node running without a package.json alongside the code (#105)

[3.2.0]

  • Add support for push metrics tracking endpoint (#98)

[3.1.4]

  • Add send_at to transactional message attributes (#97)
  • Set User-Agent for proper source attributes on activity logs (#96)

[3.1.3]

  • Revert #93 due to a crashing bug (#95)

[3.1.2]

  • Set User-Agent for property source attributes on activity logs (#93)

[3.1.1]

  • Fixed types for the fake_bcc parameter for transactional emails (#92)

[3.1.0]

[3.0.3]

  • Fix an issue with some instances of HTTPS.request in certain runtimes (#83)

[3.0.2]

  • Fix a few issues in the README documentation (#73)
  • Allow subject and body to be overridden independent of from for transactional messages (#75)

[3.0.1]

  • Fix an issue calculating the content length of multi-byte utf-8 string characters (#69)

[3.0.0]

  • (BREAKING) Remove the dependency on request (#62)

    • We don't expect this to break many consumers of customerio-node. Unless you were using request specific options, you don't need to make any changes.
  • (BREAKING) Return an Error instance for non-2XX status codes (#62)

    • We don't expect this to break many consumers of customerio-node. Unless you were using instanceof to check the type of error returned from track or api methods, you don't need to make any changed. message, statusCode, response, and body are still accessible as properties on the error.
  • (BREAKING) trackAnonymous now requires an anonymous_id and cannot trigger campaigns. If you previously used anonymous events to trigger campaigns, you can still do so directly through the API. We now refer to anonymous events that trigger campaigns as "invite events".

  • (BREAKING) Restructure the package to have a single entry point, rather than three. This is more of a standard package structure, and is more future-proof. (#63)

  • Return a readable message when the server returns an array of errors instead of Unknown error (#62)

[2.1.1]

Changed

  • Fix exported typings for folks using customerio-node with Typescript (#56)

[2.1.0]

Changed

  • Upgrade ini from 1.3.5 to 1.3.8 (#36)

Added

  • Convert customerio-node to Typescript (#49)

[2.0.0]

Changed

  • (Breaking) Move triggerBroadcast method from Track to API class (#46)

[1.1.0]

Added

  • Support for the EU region

[1.0.0]

Added

  • Support for the Transactional API

Removed

  • addToSegment and removeFromSegment methods

Changed

  • IDs in the URLs are now escaped.
  • Improved validations for data that's passed in.

[0.7.0]

Changed

  • Catch scenarios where a response body is unexpectedly null (#25)

Added

  • Allow request defaults to be overridden (#26)
  • New API call for supressing customers (#27)

[0.6.0]

Changed

  • Add missing API params to triggerBroadcast (#19)
  • Further improve the triggerBroadcast API call and catch additional params (#20)
  • Switch from Travis CI to Circle CI (#21)

[0.5.0]

Added

  • New API calls for manual segments (addToSegment, removeFromSegment) (#16)

[0.4.0]

Added

  • New API call for adding and removing devices from push notifications (#14)

Changed

  • Huge thanks to @jescalan for his work in modernizing the Javascript to es6 along with updating dependencies. (#13)
  • README now has the correct Travis-CI badge
  • README has standardized and expanded examples (#10)
  • Fixed link in README to official Customer.io API docs
  • Cleaned up .gitignore by removing unnecessary ignore statements

Added

  • This CHANGELOG file along with historical changes to provide better transparancy to changes made to the library
  • New API call for API triggered broadcasts
    • Added a test for the new call
    • Added an example for the new call to README and examples/ dir
  • An example config file for the practical examples
  • Travis-CI builds now use currently maintained LTS versions of Node.JS (6, 8, 9)

Removed

  • .gitkeep files no longer necessary to preserve directories

0.2.0 - 2015-07-22

Removed

  • url.resolve() removed from API calls

0.1.0 - 2015-07-22

Added

  • Initial API client library
    • Create Identify call
    • Create Track call
    • Create Track Page View call
    • Create Customer Delete call
    • Test suite for API calls
  • HTTP Request middleware
    • Create request handler with RSVP.js
    • Create options method for unifying all request calls
    • Create POST request
    • Create PUT request
    • Create DELETE request
    • Test suite for middleware