Getting Started
Once set up, your app will be able to connect and create embedded wallets for users.
Try the demo
See Embedded Wallets in action with our demo app:
Installation
Install the required packages:
npx thirdweb install
This command will recognize the environment you are working in and install the appropriate packages.
Connecting & Creating Embedded Wallets in an Application
- React
- React Native
- TypeScript
- Unity
import {
ThirdwebProvider,
ConnectWallet,
embeddedWallet,
} from "@thirdweb-dev/react";
export default function App() {
return (
<ThirdwebProvider
activeChain="goerli"
clientId="YOUR_CLIENT_ID"
supportedWallets={[embeddedWallet()]}
>
<ConnectWallet />
</ThirdwebProvider>
);
}
import {
ThirdwebProvider,
ConnectWallet,
embeddedWallet,
} from "@thirdweb-dev/react-native";
export default function App() {
return (
<ThirdwebProvider
clientId="YOUR_CLIENT_ID"
supportedWallets={[embeddedWallet()]}
>
<ConnectWallet />
</ThirdwebProvider>
);
}
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", // Your thirdweb client ID
});
wallet.connect();
using Thirdweb;
public async void ConnectWallet()
{
// Reference to your Thirdweb SDK
var sdk = ThirdwebManager.Instance.SDK;
// Configure the connection
var connection = new WalletConnection(
provider: WalletProvider.EmbeddedWallet, // The wallet provider you want to connect to (Required)
chainId: 1, // The chain you want to connect to (Required)
email: "email@email.com" // The email you want to authenticate with (Required)
);
// Connect the wallet
string address = await sdk.wallet.Connect(connection);
}