Onchain payments are rapidly becoming the backbone of decentralized commerce, but friction at checkout remains a persistent barrier for both users and developers. The Base Account SDK, built atop ERC-4337, is engineered to change this dynamic. By enabling universal sign-in, one-tap USDC payments, and advanced features like passkeys and social recovery, Base is positioning itself as the most developer-friendly entry point for onchain transactions. In this visual guide, we’ll break down how to leverage the Base Account SDK for seamless onchain checkout flows, no prior experience with account abstraction required.

Screenshot of Base Account SDK checkout UI showing one-tap USDC payment button for seamless onchain transactions

Why Base Account SDK Is a Game-Changer for Onchain Checkout

The legacy onchain checkout process is notorious for its complexity: users must connect wallets, manage gas fees, and navigate unfamiliar interfaces. The Base Account SDK abstracts these hurdles by providing a programmable account layer that supports multi-chain access and sponsored gas. This means users can sign in with a single click and pay directly with USDC, no more wallet popups or manual address entry.

Key Benefits of Using Base Account SDK

  • Base Account SDK Checkout component screenshot
    Effortless Onchain Checkout Integration: Developers can quickly add seamless onchain payment flows using the <Checkout /> component, reducing integration complexity and time-to-market.
  • Base Account SDK universal sign-in and USDC payment
    Universal Sign-In and One-Tap USDC Payments: The SDK enables universal sign-in with Base and supports one-tap USDC payments, streamlining user onboarding and payment experiences.
  • Base Account SDK ERC-4337 programmable account abstraction
    Programmable, Multi-Chain Account Layer: Built on ERC-4337, the Base Account SDK offers a programmable account abstraction layer, supporting advanced features like passkeys, social recovery, sponsored gas, and transaction batching.
  • Coinbase Commerce integration with Base Account SDK
    Direct Integration with Coinbase Commerce: Developers can leverage Coinbase Commerce for product and dynamic charge management, ensuring secure, reliable, and scalable onchain payment processing.
  • Base Account SDK passkeys and social recovery features
    Enhanced Security and User Recovery Options: Features such as passkeys and social recovery provide robust security and account recovery mechanisms for end-users, reducing friction and risk.
  • Base Account SDK sponsored gas and transaction batching
    Sponsored Gas and Transaction Batching: The SDK supports sponsored gas and transaction batching, allowing users to interact onchain without needing to manage ETH for gas, improving accessibility and reducing friction.

For developers, integration is straightforward. The SDK’s modular design allows you to drop in pre-built UI components like and lt;Checkout/and gt;, while maintaining full control over backend logic via API hooks. For users, the experience is comparable to Web2 checkouts, fast, familiar, and frictionless.

Step-by-Step Integration: From Setup to First Checkout

Let’s walk through the integration process using a Next. js project scaffolded with wagmi. This approach ensures compatibility with modern frontend stacks while leveraging wagmi’s robust wallet management.

Integrate Base Account SDK with wagmi in Next.js: Step-by-Step

A developer opening a terminal and running a command to create a new Next.js project with wagmi, showing a code snippet on screen.
Initialize a Next.js Project with wagmi
Start by creating a new Next.js project using the wagmi starter. This sets up a modern React environment with out-of-the-box wallet support.
A package manager terminal installing @base-org/account and @base-org/account-ui in a code editor environment.
Install Base Account SDK and UI Components
Add the Base Account SDK and its UI components to your project. This enables advanced account features and seamless onchain interactions.
A code editor displaying JavaScript code configuring wagmi with baseSepolia and the Base Account connector.
Configure wagmi for Base Networks
Import the necessary modules and set up wagmi to connect to Base networks, such as baseSepolia. Add the Base Account connector to enable 'Sign in with Base' functionality.
A web app interface showing a 'Sign in with Base' button and a user authentication modal.
Enable Sign In with Base
With the configuration complete, your app now supports universal sign-in via Base Accounts. This allows users to authenticate with passkeys and social recovery features.
A web checkout UI with a Coinbase-branded button and product details, highlighting seamless onchain payment.
Implement the Onchain Checkout Component
Integrate the component to provide a one-click onchain checkout experience. Sign up for Coinbase Commerce, create a product, and use its productId in your code.
A backend server icon connecting to a web app, illustrating API communication for dynamic onchain charges.
Set Up Dynamic Charges (Optional)
For dynamic pricing, implement a backend endpoint that creates charges using the Coinbase Commerce API. Pass a chargeHandler prop to the Checkout component for real-time charge generation.

1. Initialize Your Project Environment
Run the following commands to bootstrap your workspace:

Project Initialization and SDK Installation

To begin integrating the Base Account SDK, first scaffold a new project using the wagmi template. Then, navigate into your project directory and install the necessary Base Account SDK packages:

npm create wagmi@latest base-accounts-demo
cd base-accounts-demo
npm install @base-org/account @base-org/account-ui

These commands set up your development environment with all required dependencies for utilizing Base Account SDK and its UI components.

2. Configure wagmi with Base Networks
Import modules and define your configuration:

Import Required Modules and Connectors

First, import the necessary modules and connectors to set up your configuration for onchain checkout using the Base Account SDK.

import { http, createConfig } from 'wagmi';
import { baseSepolia } from 'wagmi/chains';
import { baseAccount } from '@wagmi/connectors';
// ... see full code above

These imports provide access to the required network, connector, and configuration utilities. You'll use them to initialize your checkout flow in the next steps.

This enables “Sign in with Base” as an authentication connector, a critical step for universal onboarding.

Implementing Effortless Onchain Checkout

The heart of frictionless commerce on Base is the and lt;Checkout/and gt; component. Once your backend is ready (for dynamic charges) or you’ve created products in Coinbase Commerce (for static checkouts), embedding the payment UI is as simple as:

Integrating Coinbase OnchainKit Checkout in React

To integrate the Coinbase OnchainKit checkout into your React application, import the necessary components and use them as shown below. Replace `'your-product-id'` with the actual product ID you wish to offer for purchase.

import { Checkout, CheckoutButton } from '@coinbase/onchainkit/checkout';


  

This setup renders a Coinbase-branded checkout button that initiates the onchain purchase flow when clicked.

This delivers a branded one-tap payment experience directly within your dApp or site.

Sponsoring Gas Fees and Advanced UX Features

The programmable nature of accounts built on ERC-4337 unlocks additional capabilities like gas sponsorship (where you pay fees for your users) and batched transactions (multiple actions in one signature). These features are essential for mainstream adoption, users expect payments to "just work" without technical distractions.