Skip to main content
Learn how to integrate CDP wallets as a wallet provider with the Gelato Bundler for sponsored user operations.

Prerequisites

  • A free CDP Portal account and project
  • Node.js 22+
  • A node package manager installed (i.e., npm, pnpm, or yarn)
  • Basic familiarity with React and TypeScript
  • Configured your domain in CDP Portal (see below)
Step 1: Access CDP PortalNavigate to the Clients Configuration in CDP Portal, and click Add domain to include your local app.Step 2: Add your domain
  • For local development: Use http://localhost:3000 (or your preferred port)
  • For production: Use your actual domain (e.g., https://yourapp.com)
For production apps, only add your actual production domain. Do not add localhost to production CDP projects as malicious apps running locally could impersonate your frontend and abuse your project credentials.
Step 3: Save your changesClick Add domain again to save your changes. You should see your domain listed in the CDP Portal dashboard. The allowlist will take effect immediately upon saving.You should see your domain listed in the CDP Portal dashboard. The allowlist will take effect immediately upon saving.
  • A Gelato account with an app and API key generated from Paymaster & Bundler > API Keys
Install the required CDP packages:
1

Set up .env file

Set the environment variables in your .env.local file:
2

Import Dependencies

src/App.tsx
3

Configure React provider

Set up the CDP React Provider in your app:
src/App.tsx
4

Create Bundler Client

Set up your component to use Coinbase CDP hooks and create a bundler client with Gelato integration:
src/App.tsx
5

Send User Operations

Send sponsored user operations using the bundler client:
src/App.tsx