When asking for help in this category, please make sure to provide the following details:
SDK version 9.5.3
Web and Android but mainly web, then I will use AppMySite
The console didn’t have anything except for this warning:
const clientId =
"BKVU0F8x9OV8Ty42fYg5a2QxcLKucvaSpIGj-uv2JMOfrN8axhggKo-c3q********************";
const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0xaa36a7",
rpcTarget: "https://rpc.ankr.com/eth_sepolia",
displayName: "Ethereum Sepolia Testnet",
blockExplorerUrl: "https://sepolia.etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png",
};
const privateKeyProvider = new EthereumPrivateKeyProvider({
config: { chainConfig },
});
const web3auth = new Web3Auth({
clientId,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET
privateKeyProvider,
});
useEffect(() => {
const init = async () => {
try {
await web3auth.initModal();
} catch (e) {
console.log("Error initializing modal", e);
}
try {
setProvider(web3auth.provider);
if (web3auth.connected) {
setLoggedIn(true);
const user = (await web3auth.getUserInfo()) as any;
setUserInfo(user);
if (user.email) {
localStorage.setItem("userEmail", user.email);
try {
await createUser(user?.email, user?.name || "Anonymous User");
} catch (error) {
console.error("Error creating user:", error);
// Handle the error appropriately, maybe show a message to the user
}
} else if (user.oAuthIdToken) {
try {
await createUser(user.email, user?.name || "Anonymous User");
} catch (error) {
console.error("Error creating user:", error);
// Handle the error appropriately, maybe show a message to the user
}
}
}
} catch (error) {
console.error("Error initializing Web3Auth:", error);
} finally {
setLoading(false);
}
};
init();
}, []);
I’ve also whitelisted the domains in my web3Auth dashboard:
I need this project done ASAP so please help me!