web3auth.init({ provider: privateKeyProvider });
const connect = async () => {
try {
const web3authNodeprovider = await web3auth.connect({
verifier: "bowled-custom-test", // e.g. `web3auth-sfa-verifier` replace with your verifier name, and it has to be on the same network passed in init().
verifierId: "46", // e.g. `Yux1873xnibdui` or `name@email.com` replace with your verifier id(sub or email)'s value.
idToken:
"eyJraWQiOiI1NjgxYzRmOC1jZTFlLTQ1MGEtODNhOC02ZDFlZjYzMGU5YmQiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI0NiIsImV4cCI6MTcwODQwNjMyNSwiaWF0IjoxNzA3OTc0Mzg1fQ.TAa1ingBZq8claCr6s05Q_NpKGqEDtL5ffi2VLKha5naSThiDodWLyHLSyjfZmQ3jaaSAPhlHXiTU-JYuvCtW282X7BDlwtfmxwhrprxKywKk6Mi-0-RUgUm4Y1LEh4GhVcWCkywgR17PUSlyHDWeZ6u7ET_Yqwwm1AL75LPi9KGXR7K-jVw7ImBh23CDunyegqEh-fgkj-wRtQAu70IQiITeYLor75uDjWzo1KijToiaaa8ysyidpeGxBsZu2K9aXtGKdvuyZZhVnX3KcX9QvtJQuHh4N9Uvg_9pBG_dnZBO7lwbYlbjsRUfOjYiooIrW5yBNR-rWxOxsOSUG5amg",
});
const ethPrivateKey = await web3authNodeprovider.request({
method: "eth_private_key",
});
// The private key returned here is the CoreKitKey
console.log("ETH Private Key", ethPrivateKey);
} catch (error) {
console.error("Error connecting to Web3Auth:", error);
}
};
connect();