Repository navigation
Conversation
Node.js 18 and 20 have reached end of life, so raise engines.node to
>=22, test on 22 and 24, and bump to 5.0.0. The publish and API
reference workflows move to Node 24 as well, since pnpm refuses to
install a project whose own engines field doesn't match the running
Node.
The user-agent tests expected runtime_env=Node/<version>, which the SDK
only adds when navigator.userAgent doesn't already name Node. Node 21+
defines navigator.userAgent ("Node.js/22"), so the tests now assert
that prefix instead. SDK behavior is unchanged.
BREAKING CHANGE: Node.js 18 and 20 are no longer supported.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Raises the minimum Node.js version from 18 to 22 and bumps the SDK to 5.0.0. Node.js 18 reached end of life in April 2025 and Node.js 20 in April 2026, so 22 is the oldest release line still getting security fixes. There are no SDK code changes; this release only changes which Node versions are supported and tested.
Changes
package.json:engines.node>=18→>=22, version4.41.4→5.0.0CHANGELOG.md:[5.0.0]entry, marked Breakingtest.yml: matrix18, 20→22, 24publish.yml,api-reference.yml,version-bump.yml: Node 20 → 24. This is required for the first two: pnpm refuses to install a project whose ownenginesdoesn't match the running Node, so releases would fail on 20.docs/compat.md,CLAUDE.md: now say 22+;compat.mdpoints Node 18/20 users to v4src/utils/live.ts: a comment no longer says Node 18 "is still supported"tests/unit/utils.test.ts: three user-agent assertions, explained belowWhy the user-agent tests changed
They would have failed on the new matrix. Node 21 added a global
navigator.userAgent("Node.js/22").buildUserAgentuses it as the User-Agent prefix and deliberately skipsruntime_env=Node/<version>when that string already names Node. CI only ever ran 18 and 20, so the tests expectedruntime_env. They now assert theNode.js/<major>prefix. SDK behavior is unchanged.Worth knowing: requests from Node 21+ already send only the Node major version and no
runtime_env, so anything that readsruntime_envfrom the User-Agent for analytics is missing those users today.Why a major version
Yarn 1 enforces dependency
enginesby default, as do npm and pnpm withengine-strict. Released as 4.x, this would break installs for anyone on Node 18/20 with a^4range.Testing
node_moduleshad drifted from the lockfile (TypeScript 5.9 vs 5.4). CI covers type-checking.Notes
src/utils/live.tsstill has two Node 18/20 workarounds (Math.randomfor multipart boundaries, and a hand-rolleddeadlineSignalinstead ofAbortSignal.any, which would also raise the minimum Safari version to 17.4), and@types/nodeis still^18.🤖 Generated with Claude Code