Embedded Wallet
Prompt users to connect to your app using their email with Embedded Wallet.
Usage
import { EmbeddedWallet } from "@thirdweb-dev/wallets";
import { Ethereum } from "@thirdweb-dev/chains";
const wallet = new EmbeddedWallet({
chain: Ethereum, // chain to connect to
clientId: "your_client_id", // client ID
});
wallet.connect();
Configuration
Provide a configuration object when instantiating the EmbeddedWallet
class.
clientId (required)
chain (required)
chains (optional)
styles (optional)
walletStorage (optional)
Methods
Inherits all the public methods from the AbstractClientWallet
class.
connect
open the Embedded Wallet's Modal and prompt the user to log in with their email address. Once connected, it returns the public wallet address assigned to the user.
await wallet.connect();
Configuration
getEmail
Get the email associated with the currently connected wallet.
const email = await wallet.getEmail();