Skip to main content
Learn how to set up Wagmi with Coinbase Wallet to enable Coinbase Wallet SDK functionality with familiar React hooks.

Overview

Wagmi is a collection of React hooks for Ethereum Virtual Machine (EVM) compatible networks that makes it easy to work with wallets, contracts, transactions, and signing. Coinbase Wallet integrates perfectly with Wagmi, allowing you to use all your familiar hooks. You can jump ahead and use the Coinbase Wallet Wagmi Template to get started.

Installation

Option 1: New wagmi Project

1

Create a New wagmi Project

To create a new wagmi project, you can use the command line:
2

Override the Coinbase Wallet SDK Version

To get access to the latest version of the Coinbase Wallet SDK within Wagmi, you can use the following command to override it:
Or you can use a specific version by adding the version to the overrides:
3

Install the Dependencies

Install the dependencies with your package manager of choice:
If this is not your first installMake sure to delete your node_modules and package-lock.json and run a new install to ensure the overrides are applied.

Option 2: Existing Project

1

Override the Coinbase Wallet SDK Version

To get access to the latest version of the Coinbase Wallet SDK within Wagmi, you can use the following command to override it:
Or you can use a specific version by adding the version to the overrides:
2

Install the Dependencies

Install the dependencies with your package manager of choice:
If this is not your first installMake sure to delete your node_modules and package-lock.json and run a new install to ensure the overrides are applied.

Configuration

1. Configure wagmi with Coinbase Wallet

Create your Wagmi configuration with the Coinbase Wallet connector configured for Coinbase Wallet:
app/wagmi.ts

2. Wrap Your App

Wrap your application with the Wagmi provider and QueryClient provider:

Create a Simple Page (Sign in with Base)

Create a simple landing page that uses Sign In With Base to authenticate the user
This is a simple example to get you started. You will need to add your own backend logic to verify the signature and authenticate the user.You can find a complete example in the Coinbase Wallet Wagmi Template.

Run the wagmi App

Run the application with your package manager of choice:
Wagmi Setup
What you will see when you navigate to the page

Next Steps

Now that you have Wagmi configured with Coinbase Wallet, you can: