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:
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:
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 userRun the wagmi App
Run the application with your package manager of choice:
What you will see when you navigate to the page