Archived Content from Web3Auth Community
This topic was originally posted by bsrinath4839 on 9/1/2025.
This content has been migrated from our previous community forum to preserve valuable discussions.
When asking for help in this category, please make sure to provide the following details:
-
SDK Version(package.json):
“@toruslabs/eccrypto”: “^6.0.0”,
“@web3auth/auth-adapter”: “^9.5.2”,
“@web3auth/base”: “^9.5.2”,
“@web3auth/base-provider”: “^9.5.2”,
“@web3auth/no-modal”: “^9.5.2”, -
Platform:
Web -
Browser Console Screenshots:
-
If the issue is related to Custom Authentication, please include the following information (optional):
- Verifier Name:
- JWKS Endpoint:
- Sample idToken (JWT):
import { Web3AuthNoModal as Web3Auth } from "@web3auth/no-modal"; import { CommonPrivateKeyProvider } from "@web3auth/base-provider"; import { web3AuthChainConfig, web3AuthCliedId } from "./constants"; import { ADAPTER_EVENTS, WEB3AUTH_NETWORK } from "@web3auth/base"; import { AuthAdapter } from "@web3auth/auth-adapter"; import { KEPLR_CONNECTED, KEPLR_CONNECTING, KEPLR_DISCONNECTED, KEPLR_ERRORED } from "./events.keplr";export const initWeb3Auth = async ({
handleKeplrConnected = ()=> { },
handleKeplrConnecting = ()=> { },
handleKeplrDisconnected = ()=> { },
handleKeplrErrorred = ()=> { },
handleWeb3AuthConnected = ()=> { },
handleWeb3AuthConnecting = ()=> { },
handleWeb3AuthDisconnected = ()=> { },
handleWeb3AuthErrored = ()=> { },
}) => {
try {
const privateKeyProvider = new CommonPrivateKeyProvider({
config: { chainConfig: web3AuthChainConfig },
});window.web3auth = new Web3Auth({ clientId: web3AuthCliedId, privateKeyProvider, uiConfig: { appName: "Sentinel AI", logoDark: `${window.location.origin}/logo512.svg`, logoLight: `${window.location.origin}/logo512.svg`, mode: "auto", useLogoLoader: true, }, web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET, }); const authAdapter = new AuthAdapter({ adapterSettings: {}, loginSettings: { mfaLevel: "optional" }, }); window.web3auth.configureAdapter(authAdapter); await window.web3auth.init(); window.web3auth.on(ADAPTER_EVENTS.CONNECTING, handleWeb3AuthConnecting); window.web3auth.on(ADAPTER_EVENTS.CONNECTED, handleWeb3AuthConnected); window.web3auth.on(ADAPTER_EVENTS.DISCONNECTED, handleWeb3AuthDisconnected); window.web3auth.on(ADAPTER_EVENTS.ERRORED, handleWeb3AuthErrored); window.addEventListener(KEPLR_CONNECTED, handleKeplrConnected); window.addEventListener(KEPLR_DISCONNECTED, handleKeplrDisconnected); window.addEventListener(KEPLR_CONNECTING, handleKeplrConnecting); window.addEventListener(KEPLR_ERRORED, handleKeplrErrorred); return true;} catch (e) {
console.log(“::ERROR::”, e);
return false;
}
};
