https://YOUR-DOMAIN", // if using Auth0, Cognito or Firebase.
verifierIdField: "sub",
},
});
const provider = new ethers.providers.Web3Provider(web3auth.provider);“>
import { Web3AuthCore } from ”@web3auth/core";
import { OpenloginAdapter } from “@web3auth/openlogin-adapter”;
import { WALLET_ADAPTERS, CHAIN_NAMESPACES } from “@web3auth/base”;
import { ethers } from “ethers”;
const web3auth = new Web3AuthCore({
clientId: “YOUR_CLIENT_ID”, // get it from Web3Auth Dashboard
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: “0x3”, // ropsten, hex of 3
},
});
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId: “YOUR-WEB3AUTH-CLIENT-ID”,
network: “testnet”,
uxMode: “popup”,
loginConfig: {
jwt: {
name: “Name of your choice”,
verifier: “YOUR-VERIFIER-NAME-ON-WEB3AUTH-DASHBOARD”,
typeOfLogin: “jwt”,
clientId: “YOUR-CLIENTID-FROM-SOCIAL-PROVIDER”,
},
},
},
});
web3auth.configureAdapter(openloginAdapter);
await web3auth.init();
// Login
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: “jwt”,
extraLoginOptions: {
domain: “https://YOUR-DOMAIN”, // if using Auth0, Cognito or Firebase.
verifierIdField: “sub”,
},
});
const provider = new ethers.providers.Web3Provider(web3auth.provider);