npm / @segment/analytics-node
@segment/analytics-node
What changed in @segment/analytics-node 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
3 breaking4 new APIs and options3 behavior and defaults1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@segment/analytics-node 38 changes
Breaking changes 1
The package requires Node.js 20 or later, so applications using it must run on a supported Node.js version.
New APIs and options 3
Adds an emitter event for observing API response status codes and headers.
Adds a setting to control the rate-limit retry ceiling.
Adds a setting to control the total retry backoff ceiling.
Behavior and default changes 3
Raises the default timeout floor to 75 seconds from 12.5 seconds so it survives at least one Retry-After: 60 cycle.
Aligns publisher retry and status behavior with updated response handling rules.
Updates the default retry configuration to increase resilience under transient failures.
Fixes and other changes 1
Cancels pending retry sleeps with AbortController when the call times out, instead of silently swallowing the timeout error and dropping in-flight events.
@segment/analytics-node 23 changes
Breaking changes 2
For custom HTTPClient implementations, the data field changed to body, which is a string; data processing now occurs before calls to makeRequest.
Support for Node.js 14 and 16 was removed because they are EOL.
New APIs and options 1
Segment OAuth2 is supported through the new OAuthSettings type, which can be provided in Analytics configuration.