Get Started with wallets

There are 4 types of wallets you can integrate into your app with thirdweb:

  • External Wallets - Connect to existing web3 wallets like MetaMask, Coinbase Wallet, etc.
  • In-App Wallets - Create embedded, branded and customizable wallets for your app, or game.
  • Ecosystem Wallets - Create a branded and customizable wallet offering users a unified identity across your entire ecosystem of apps or games.
  • Smart Wallets (Account Abstraction) - leverage account abstraction to unlock complex functionality such as gasless & signless transactions.

These methods can be used independently or together in the same application to provide the best experience for your users.

Get your Client ID

To use wallet features in your applications, you will need a client ID. Generate one for free at your thirdweb dashboard.

Your client ID authenticates your application with thirdweb's services and provides access to infrastructure like RPC endpoints, IPFS gateways, and wallet services.

Live Playground

Before diving into the implementation, check out our playground to see all the various capabilities of Connect:

Try the demo

Play around with various wallet connection options

Choose Your Framework/Language

Installation

Install the thirdweb SDK in your TypeScript project:

npm install thirdweb
# or
yarn add thirdweb
# or
pnpm add thirdweb

Set up the Client

First, create a client instance to connect with thirdweb services:

import { createThirdwebClient } from "thirdweb";
// For client-side applications:
const client = createThirdwebClient({
clientId: "YOUR_CLIENT_ID", // Get from your thirdweb dashboard
});
// For server-side scripts (Never expose secret keys in client code):
// const client = createThirdwebClient({
// secretKey: process.env.THIRDWEB_SECRET_KEY,
// });

Connect External Wallets

Enable users to connect their existing wallets:

import { createThirdwebClient, walletConnect } from "thirdweb";
// Create the client (do this once and reuse it)
const client = createThirdwebClient({
clientId: "YOUR_CLIENT_ID",
});
// Connect WalletConnect
const wallet = walletConnect({
projectId: "YOUR_WALLETCONNECT_PROJECT_ID", // Get from WalletConnect dashboard
});
// Connect the wallet
const walletInstance = await wallet.connect();
const address = await walletInstance.getAddress();
console.log("Connected to:", address);
// Read wallet balance
import { getWalletBalance, ethereum } from "thirdweb";
const balance = await getWalletBalance({
client,
chain: ethereum,
address: walletInstance.getAddress(),
});
console.log(`Balance: ${balance.displayValue} ${balance.symbol}`);

Setup In-App Wallet

Create wallets with email or social login:

import { createThirdwebClient, embeddedWallet } from "thirdweb";
// Create the client (do this once and reuse it)
const client = createThirdwebClient({
clientId: "YOUR_CLIENT_ID",
});
// Initialize embedded wallet
const wallet = embeddedWallet({
client,
});
// Connect with email
const emailWallet = await wallet.connect({
strategy: "email",
});
// Connect with social login
const googleWallet = await wallet.connect({
strategy: "google",
});

Setup Ecosystem Wallet

Create a single unified identity for your users with our branded, customizable wallets built for supporting multiple apps and games within an entire ecosystem.

import { createThirdwebClient, ecosystemWallet } from "thirdweb";
// Create the client (do this once and reuse it)
const client = createThirdwebClient({
clientId: "YOUR_CLIENT_ID",
});
// Initialize ecosystem wallet
const wallet = ecosystemWallet({
client,
ecosystemId: "YOUR_ECOSYSTEM_ID", // Get from your ecosystem dashboard
});
// Connect with email
const emailWallet = await wallet.connect({
strategy: "email",
});

Next Steps

After setting up wallet functionality, explore these advanced topics:

Explore Full SDK Documentation

For comprehensive guides on implementing the full thirdweb SDK, explore our language-specific documentation: