feat: support custom wagmi connectors in WagmiAdapter#530
feat: support custom wagmi connectors in WagmiAdapter#530ignaciosantise merged 2 commits intodevelopfrom
Conversation
Enables users to pass custom Wagmi connectors when initializing the WagmiAdapter. Removes the redundant connectors override from ConfigParams to use wagmi's native CreateConnectorFn[] type. Users can now provide custom connector factories via the config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 3bd49d8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude finished @ignaciosantise's task —— View job PR Review Complete ✅Reviewed PR: feat: support custom wagmi connectors in WagmiAdapter Todo List:
Review FeedbackIssues Found1. Type Inconsistency in Implementation (packages/wagmi/src/adapter.ts:56) The change correctly passes through user-provided connectors, but there's a subtle type mismatch: connectors: [...(configParams.connectors ?? [])]The issue is that Recommendation: connectors: configParams.connectors ?? []The spread operator adds no value and could cause confusion. If 2. Missing Documentation The PR removes explicit type override but doesn't document the new capability. Users need to know:
Recommendation: Add JSDoc comments to the type ConfigParams = Partial<CreateConfigParameters> & {
networks: readonly [Chain, ...Chain[]];
projectId: string;
/**
* Optional custom Wagmi connector factory functions.
* These will be added to the Wagmi config alongside the internal UniversalConnector.
* @example
* const adapter = new WagmiAdapter({
* projectId,
* networks,
* connectors: [injected(), walletConnect({ projectId })]
* });
*/
};3. Potential Connector Collision (packages/wagmi/src/adapter.ts:164-169) The adapter dynamically adds the Recommendation: Document this behavior or add validation to warn about potential conflicts. 4. Changeset Scope Mismatch (.changeset/fix-security-vulnerabilities.md) This changeset appears to be unrelated to the PR's stated purpose (custom connectors). Including security fixes in a feature PR makes it harder to:
Recommendation: Split security fixes into a separate PR for cleaner history and easier maintenance. Positive Observations (Not Issues)
SummaryThe core change is sound and improves type correctness. Main concerns:
|
There was a problem hiding this comment.
Pull request overview
Enables passing Wagmi-native custom connector factory functions into WagmiAdapter so consumers can customize connector configuration while keeping the adapter’s existing “programmatic connect” flow intact.
Changes:
- Removes the incorrect
connectors?: Connector[]override fromConfigParamsand relies onCreateConfigParameters’ nativeconnectorstype. - Passes through user-provided
connectorsintocreateConfig, defaulting to an empty array when unspecified. - Adds a changeset entry documenting the new capability (and a minor formatting tweak in an existing security changeset).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/wagmi/src/adapter.ts | Accepts Wagmi connector factory functions via configParams.connectors and forwards them to createConfig. |
| .changeset/fix-security-vulnerabilities.md | Minor Markdown formatting adjustment (blank line before list). |
| .changeset/custom-wagmi-connectors.md | Adds a changeset documenting support for custom Wagmi connectors in WagmiAdapter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The security fixes in PR #522 only affected resolutions/overrides in the root package.json and sample app — no SDK source code changed, so bumping all 9 published packages is not needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|



Summary
Enables users to pass custom Wagmi connectors when initializing the WagmiAdapter. This change removes the redundant
connectors?: Connector[]override fromConfigParamsand instead uses wagmi's nativeCreateConnectorFn[]type, allowing developers to customize connector configuration while maintaining backward compatibility.Changes
connectorstype override fromConfigParamsConnector[]instead of factory functions)Closes
#529
Note
Low Risk
Small config wiring/type-surface change limited to connector initialization; main risk is unexpected connector ordering/behavior differences for consumers providing custom connectors.
Overview
WagmiAdapternow forwards any user-provided wagmiconnectorsfromConfigParamsintocreateConfig, instead of always initializing with an empty connector list.Adds a changeset for
@reown/appkit-wagmi-react-nativeand removes the prior security-vulnerability changeset entry.Written by Cursor Bugbot for commit 3bd49d8. This will update automatically on new commits. Configure here.