Skip to main content
Learn how to set up Thirdweb with Base Account to enable seamless user authentication and wallet management.

Overview

Thirdweb provides a complete onchain application development framework with wallet connection, authentication, and smart contract interactions. By integrating Thirdweb with Base Account, you can leverage Thirdweb’s ConnectButton component while providing users with native Base Account wallet support.

What you’ll achieve

By the end of this guide, you will:
  • Set up Thirdweb with Base Account support
  • Have Base Account available as a wallet option alongside email authentication
  • Use Thirdweb’s ConnectButton for a polished wallet connection experience
You can jump ahead and use the Base Account Thirdweb Template to get started.

Installation

1. Create a new Next.js project

2. Install the dependencies

Install the Thirdweb SDK (version 5.118.0 or higher is required for Base Account support):

Configuration

1. Set up Environment Variables

Create a .env.local file in your project root:
Get your Client ID from the Thirdweb Dashboard.

2. Create the Thirdweb Client

Create a client configuration file:
src/lib/client.ts

3. Configure ThirdwebProvider

Create a providers wrapper component and update your layout:

Usage

Use Thirdweb’s ConnectButton with your wallet configuration:
src/app/page.tsx

3. Run the project locally

You’re done! Run the project locally:
You should see a page with a “Sign In” button. Clicking it will open the Thirdweb connect modal with Base Account and email authentication options.
Base × Thirdweb Demo

Customization

Wallet Options

You can customize which wallets appear in the connect modal:

Theme

Customize the appearance using lightTheme or darkTheme:

Chain

Change the default chain by importing from thirdweb/chains:

Resources