Hello,
I’m new to web3 and I’m developing a dapp in javascript that allows users to verify web3 claims, but I’ve been having problems with the wallet login. Whenever I try to connect to Metamask a QR code appears, even on mobile. I’ve tried to change the logic of how this works by attempting deep linking without success. Am I missing something here? how do you normally do this?
The weird things is that, when clicking on the “See all wallets” button, the metamask link there takes me directly to the metamask app installed on my phone, the way it’s supposed to be
I’ve been following the instructions of web3auth docs and this site: Connect to MetaMask using Web3Auth SDK | MetaMask developer documentation
Below is my package.json:
"dependencies": {
"@tailwindcss/vite": "^4.0.6",
"@tanstack/react-query": "^5.83.0",
"@web3auth/base": "^9.7.0",
"@web3auth/metamask-adapter": "^8.12.4",
"@web3auth/modal": "^10.0.5",
"@web3auth/openlogin-adapter": "^8.12.4",
"@zkmelabs/widget": "^0.3.5",
"ethers": "^5.7.2",
"lucide-react": "^0.475.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwindcss": "^4.0.6",
"view": "^1.1.1"
}
and my wallet login method:
import {
useWeb3Auth,
useWeb3AuthConnect,
useWeb3AuthDisconnect,
} from "@web3auth/modal/react";
const App = () => {
const { provider, isConnected, isInitialized } = useWeb3Auth();
const { connect, loading: connecting } = useWeb3AuthConnect();
const handleConnect = async () => {
if (!isInitialized) {
console.warn("Web3Auth not initialized yet");
return;
}
setLoading(true);
try {
await connect();
setConnectRequested(true);
} catch (err) {
setError(err.message);
} finally {
setLoading(false);
}
};
also my main.jsx:
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { Web3AuthProvider } from "@web3auth/modal/react";
import { CHAIN_NAMESPACES, WALLET_ADAPTERS } from "@web3auth/base";
import "./index.css";
import App from "./App.jsx";
createRoot(document.getElementById("root")).render(
<StrictMode>
<Web3AuthProvider
config={{
web3AuthOptions: {
clientId: import.meta.env.VITE_WEB3AUTH_CLIENT_ID,
web3AuthNetwork: "sapphire_devnet",
},
}}
enableLogging={true}
uiConfig={{
appName: "Everi",
}}
>
<App />
</Web3AuthProvider>
</StrictMode>
);
Thank you,