You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a logger option to createAppKit and forwards it through connector initialization into @walletconnect/universal-provider, with a changeset for the release.
The public types now accept WalletConnect logger levels including fatal or a pino-compatible logger shape instead of a generic object, so consumers can disable WalletConnect core logs without passing invalid logger values.
This gives SDK integrators explicit control over WalletConnect logging while preserving the default behavior when logger is omitted.
Validation: yarn format, yarn lint, and yarn test.
Run data classification subagent — no issues found
Run breaking changes subagent — no issues found
Post consolidated review
Found 2 issue(s)
Issue 1: Type duplication — WalletConnectLoggerLevel and WalletConnectLogger redefined locally instead of imported
ID: types-logger-type-duplication-a3f1 File:packages/appkit/src/types.ts:16-26 Severity: MEDIUM Category: code_quality
Context:
Pattern:WalletConnectLoggerLevel (line 16) and WalletConnectLogger (lines 18–26) are defined as local private types in types.ts, byte-for-byte copies of the types exported from packages/common/src/types/wallet/connector.ts (lines 35–53), which are re-exported through the @reown/appkit-common-react-native package already imported at the top of types.ts.
Risk: Two canonical definitions of the same type in the same repo. If one is updated (e.g., a new log level added to WalletConnectLoggerLevel), the other silently falls out of sync without a compile error, because the local types in types.ts are private and not structurally checked against the exported ones.
Impact: Silent drift between the public API type (AppKitConfig.logger) and the internal connector type (ConnectorInitOptions.logger), leading to consumers being able to pass values that the connector rejects at runtime.
Trigger: Any future change to WalletConnectLoggerLevel or WalletConnectLogger in connector.ts that isn't mirrored in types.ts.
Recommendation: Import from common instead of redefining:
Pattern:ops.logger as UniversalProviderOpts['logger'] asserts the custom WalletConnectLogger shape into WalletConnect's internal logger type without structural verification. UniversalProviderOpts['logger'] is pino's Logger, which has additional members beyond the subset defined in WalletConnectLogger (e.g., level, silent, levelVal, isLevelEnabled, serializers, etc.).
Risk: A consumer passing a minimal custom logger object (matching only WalletConnectLogger) will pass TypeScript compilation but may cause a runtime error if WalletConnect internally accesses pino-specific fields like .level or .isLevelEnabled.
Impact: Runtime crash or silent no-op when a consumer passes a custom logger object and WalletConnect tries to introspect it.
Trigger: Consumer passes a custom logger object (not a string level); WalletConnect internally reads pino-specific fields on it.
Recommendation: Narrow the cast or validate at the boundary:
// Option A: use `unknown` cast chain to make the assertion explicit
logger: ops.loggerasunknownasUniversalProviderOpts['logger']// Option B: accept only string levels for now if full pino Logger is too broad for the type
logger?: WalletConnectLoggerLevel// drop custom logger object support until types align
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
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.
This adds a
loggeroption tocreateAppKitand forwards it through connector initialization into@walletconnect/universal-provider, with a changeset for the release.The public types now accept WalletConnect logger levels including
fatalor a pino-compatible logger shape instead of a genericobject, so consumers can disable WalletConnect core logs without passing invalid logger values.This gives SDK integrators explicit control over WalletConnect logging while preserving the default behavior when
loggeris omitted.Validation:
yarn format,yarn lint, andyarn test.