We’re integrating Web3Auth into our Next.js app. However, I’m unable to connect to the wallet even though the external wallet adapter is configured.
I’m following the integration guide from Web3Auth’s builder documentation.
I’ve attached a screenshot from their demo app for reference: Demo App Github Repo
Thanks for sharing the details and code snippet! I see you’re integrating Web3Auth Plug n Play (Web Modal SDK) into your Next.js app, but the “Connect With Wallet” button isn’t appearing, even though your external wallet adapter is configured.
Here’s a summary for the support team:
Issue Summary
SDK: Web3Auth Plug n Play (Web Modal SDK)
Platform: Next.js
Problem: “Connect With Wallet” button not appearing in the UI
External Wallet Adapter: Configured, but not working as expected
Next Steps & Troubleshooting
Check Modal Initialization
Ensure web3AuthHandler (which calls web3AuthInstance.initModal()) is executed before any connection attempt, ideally on component mount (e.g., inside useEffect).
Confirm that setWeb3Auth(web3AuthInstance) updates your state correctly so state.web3Auth is available when connect() is called.
UI Trigger
Make sure you have a button or UI element that triggers the connect function, and that it’s rendered when state.web3Auth is initialized.
External Wallet Adapter Setup
If you’re using external wallet adapters (like MetaMask, WalletConnect), you must add them to your Web3Auth instance. Example from the docs:
import { MetamaskAdapter } from "@web3auth/metamask-adapter";
const metamaskAdapter = new MetamaskAdapter({ clientId: YOUR_CLIENT_ID });
web3AuthInstance.configureAdapter(metamaskAdapter);
Make sure this is done beforeinitModal().
Client ID & Network
Double-check that process.env.NEXT_PUBLIC_WEB3_AUTH_CLIENT_ID is set correctly and accessible in your environment.
Console Errors
If possible, please provide any relevant browser console errors. These can help pinpoint initialization or adapter issues.
How and when is web3AuthHandler called in your component lifecycle?
Are you configuring external wallet adapters as shown above before calling initModal()?
Any errors in the browser console?
Let us know, and we’ll help you get the “Connect With Wallet” button working!
Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours