QuickStart
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:
CatAttack: Embedded Wallet Demo App
Starting from a template
Quickly get started with one of our templates:
Embedded + Smart Wallet Starter Kit
Starting from existing project
Install the required packages:
- thirdweb CLI
- npm
npx thirdweb install
This command will recognize the environment you are working in and install the appropriate packages.
npm install @thirdweb-dev/react @thirdweb-dev/chains @thirdweb-dev/sdk ethers@5^
This command will recognize the environment you are working in and install the appropriate packages.
Get your client ID
To use embedded wallets in your applications, you will need a client ID. You can get one for free on your thirdweb dashboard.
Connecting & Creating Embedded Wallets
Quickest ways to get started with embedded wallets on each platform.
- 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
activeChain="goerli"
clientId="YOUR_CLIENT_ID"
supportedWallets={[embeddedWallet()]}
>
<ConnectWallet />
</ThirdwebProvider>
);
}
import { EmbeddedWallet } from "@thirdweb-dev/wallets";
import { Goerli } from "@thirdweb-dev/chains";
const wallet = new EmbeddedWallet({
chain: Goerli, // chain to connect to
clientId: "YOUR_CLIENT_ID", // Your thirdweb client ID
});
const authResult = await wallet.authenticate({
strategy: "google", // The authentication strategy to use, can be any of the supported strategies (google, facebook, apple, email, jwt)
});
const walletAddress = await wallet.connect({ authResult });
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: 5, // 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);
}
For more details and advanced usage, see the reference documentation for each platform.
If you're using the Typescript SDK, the code has to be running in the a browser environment due to security reasons.