Skip to main content
Version: 3.0.0

Smart Wallet Setup

This page explains how to install and upgrade Coinbase Wallet SDK.

Installing or upgrading package version

The Smart Wallet features are available in version ^4.0.0. Ensure the version is updated in package.json, for example:

{
"dependencies": {
"@coinbase/wallet-sdk": "^4.0.0-beta.0"
}
}

If you are using an aggregator library, such as wagmi, you will need to specify a resolution to use the appropriate beta library version.

{
"resolutions": {
"@coinbase/wallet-sdk": "npm:@coinbase/wallet-sdk@4.0.0-beta.0"
}
}

Usage

With SDK ^4.0.0, Smart Wallet should work just like Externally Owned Account, with no modification needed.

// Initialize Coinbase Wallet SDK
export const coinbaseWallet = new CoinbaseWalletSDK({
appName: APP_NAME,
appLogoUrl: APP_LOGO_URL,
chainIds: APP_SUPPORTED_CHAIN_IDS,
});

// Initialize Coinbase Wallet SDK, if your dapp would like to only support Smart Wallet
export const coinbaseWallet = new CoinbaseWalletSDK({
appName: APP_NAME,
appLogoUrl: APP_LOGO_URL,
chainIds: APP_SUPPORTED_CHAIN_IDS,
connectionPreference: "embedded",
});

// Initialize a Web3 Provider object
export const ethereum = coinbaseWallet.makeWeb3Provider();

// Initialize a Web3 object
export const web3 = new Web3(ethereum as any);

Create a new wallet passkey

Once the wallet starts the connection process, the end user can create, select an existing passkey wallet, or QR connect with an existing wallet. To highlight the create flow, the user will be prompted to create a passkey. The available options are based on browser, operating system, and peripherals.

  1. Select Create a wallet.
  2. Choose a provider to create a passkey.
  3. Click Continue to use this passkey as the primary signer for your new Smart Wallet.
Expand for images and click to enlarge
Select Create a wallet


Choose a provider to create a passkey


Click Continue to use this passkey

Was this helpful?