Current SDK version. Read directly from package.json so there is no
second-source-of-truth to keep in sync — bumping version in package.json
automatically propagates here and into the published artifact. The outbound
SDK User-Agent uses the resolved product version segment so source, CI,
npm pack, and prerelease builds advertise dev instead of a real-looking
release number.
Vite builds: the JSON import is replaced with a version-only shim, and
the publish path injects the release-channel define as published.
Other builds leave the define absent, so runtime chunks do not carry
unrelated package metadata.
Vitest browser mode: Vite handles the import the same way as build.
Current SDK version. Read directly from package.json so there is no second-source-of-truth to keep in sync — bumping
versionin package.json automatically propagates here and into the published artifact. The outbound SDK User-Agent uses the resolved product version segment so source, CI,npm pack, and prerelease builds advertisedevinstead of a real-looking release number.Works in every runtime the SDK targets:
published. Other builds leave the define absent, so runtime chunks do not carry unrelated package metadata.