Skip to main content

Builder Settings

Product

Plug and Play
Single Factor Auth
MPC Core Kit

SDK

Platform

import { WEB3AUTH_NETWORK, getEvmChainConfig } from "@web3auth/base";
import { getDefaultExternalAdapters } from "@web3auth/default-evm-adapter";
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
import { Web3AuthOptions } from "@web3auth/modal";

const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ"; // get from https://dashboard.web3auth.io

const chainId = 0xaa36a7; // Sepolia testnet
// Get custom chain configs for your chain from https://web3auth.io/docs/connect-blockchain
const chainConfig = getEvmChainConfig(chainId, clientId)!;

const privateKeyProvider = new EthereumPrivateKeyProvider({
config: {
chainConfig,
},
});

const web3AuthOptions: Web3AuthOptions = {
chainConfig,
clientId,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
privateKeyProvider,
};

const adapters = getDefaultExternalAdapters({ options: web3AuthOptions });

const web3AuthContextConfig = {
web3AuthOptions,
adapters: [...adapters],
};

export default web3AuthContextConfig;