fix: include projectId in API requests when value is empty string - #5631
Merged
Conversation
FetchUtil.createUrl() used `if (value)` to filter query params, which also filtered out empty strings. This caused projectId to be dropped from API requests when OptionsController hadn't been initialized yet (projectId defaults to empty string). Changed to explicit `value !== undefined && value !== null` check. Closes REOWN-4529 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
9 Skipped Deployments
|
|
Contributor
|
All contributors have signed the CTA ✍️ ✅ |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
svenvoskamp
approved these changes
Apr 13, 2026
Contributor
Author
|
I have read the CTA Document and I hereby sign the CTA |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Fixes projectId being silently dropped from api.web3modal.org requests (REOWN-4529).
Technical Report
Problem
API requests to getAnalyticsConfig and getWallets were missing the projectId query parameter, causing useAppKitWallet to not work with @reown/appkit-wallet-button.
Root Cause Analysis
FetchUtil.createUrl() used if (value) to filter query params before appending to the URL. This check filters out all falsy values — including empty strings. OptionsController defaults projectId to '' (empty string), so any API call made before OptionsController.setProjectId() runs would have projectId filtered out.
The _getSdkProperties() method reads OptionsController.state.projectId and returns it as a param. When it's still the default empty string, if (value) evaluates to false and the param is silently dropped.
Approach & Reasoning
Changed to explicit null/undefined check — if (value !== undefined && value !== null). This preserves the intended behavior of filtering out undefined params while allowing empty strings through.
Considered alternatives:
Note on empty string params: This change means params like exclude='' will now be sent as ?exclude= instead of being omitted. Reown's own API should treat empty string params the same as absent params (standard REST behavior). Low risk.
Verification
Test plan
🤖 Generated with Claude Code