Once your app is registered on base.dev, the Base App will auto-append your Builder Code to transactions its users make in your app (e.g. via your mini app, or the Base App’s browser). This powers your onchain analytics in base.dev and qualifies you for potential future rewards.
If users also access your app on the web or through other clients, you’ll need to integrate the dataSuffix parameter to capture that activity.When you register on base.dev, you will receive a Builder Code—a random string (e.g., bc_b7k3p9da) that you’ll use to generate your attribution suffix. The recommended approach is to configure dataSuffix at the client level, which appends your Builder Code to all transactions.
You can find your code anytime under Settings → Builder Code.
Install the required packages. Requires viem version 2.45.0 or higher.
Report incorrect code
Copy
Ask AI
npm i ox wagmi viem
2
Configure Your Wagmi Client
Add the dataSuffix option to your Wagmi config. This automatically appends your Builder Code to all transactions.
config.ts
Report incorrect code
Copy
Ask AI
import { createConfig, http } from "wagmi";import { base } from "wagmi/chains";import { Attribution } from "ox/erc8021";// Get your Builder Code from base.dev > Settings > Builder Codesconst DATA_SUFFIX = Attribution.toDataSuffix({ codes: ["YOUR-BUILDER-CODE"],});export const config = createConfig({ chains: [base], transports: { [base.id]: http(), }, dataSuffix: DATA_SUFFIX,});
3
Use Wagmi Hooks as Usual
With the config in place, all transactions automatically include your Builder Code—no changes to your hooks or components. This works with both useSendTransaction and useSendCalls.
App.tsx
Report incorrect code
Copy
Ask AI
import { useSendTransaction } from "wagmi";import { parseEther } from "viem";function SendButton() { const { sendTransaction } = useSendTransaction(); return ( <button onClick={() => sendTransaction({ to: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", value: parseEther("0.01"), }) } > Send ETH </button> );}