fix(node-sdk): inject SDK version at build time and make chains optional#30
Merged
chaitanyapotti merged 1 commit intoJun 17, 2026
Merged
Conversation
Replace runtime package.json reads with a build-time version constant, allow connecting without an explicit chains array, and update the demo app for ESM and viem WalletClient signer usage.
arch1995
approved these changes
Jun 17, 2026
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.
Motivation and Context
The node SDK was reading
package.jsonat runtime for analytics version tracking, which breaks in bundled environments and is unnecessary overhead. Additionally,chainswas required inWeb3AuthOptionseven though the SDK can resolve chain config from the Web3Auth API, causing friction for simple integrations.Description
__WEB3AUTH_SDK_VERSION__at build time via Rollup (rollup.config.mjs) and at test time via Vitestdefinechainsoptional inWeb3AuthOptionswith safe fallbacks inWeb3Auth(currentChainIddefaults to0x1, optional chaining forcurrentChain)dist/lib.cjs/dist/lib.esmand add package metadatademo/node-appto ESM and update EIP155 signer usage for viemWalletClient(signer.account?.address)How has this been tested?
npm run build --workspace=@web3auth/node-sdk— build succeeds;SDK_VERSIONis"5.0.0"in dist outputnpm run type-check --workspace=@web3auth/node-sdk— passesnpm run test --workspace=@web3auth/node-sdk— requires network access toapi.web3auth.ioand.env.testcredentials (integration tests)Screenshots (if appropriate):
N/A
Types of changes
Checklist: