Skip to main content
This quick-start shows the minimum code required to add Sign in with Base (SIWB) and Base Pay to any Next.js app using the Base Account SDK.

1. Create a new Next.js app

If you’re starting fresh, create a new Next.js app:
When prompted during setup, you can choose the default options or customize as needed. For this quickstart, the default settings work perfectly.

2. Install the SDK

Got a peer dependency error?Use --legacy-peer-deps flag if you get a peer dependency error.

3. Create the main component

Replace the contents of app/page.tsx (or app/page.js if not using TypeScript) with this component:
app/page.tsx
Note:Make sure to replace 0xRecipientAddress with your recipient address.
Base Pay and SIWB are independentYou DO NOT need to use SIWB to use Base Pay. You can just call the pay() function without any additional setup.

4. Start your app

Open http://localhost:3000, click Sign in with Base (optional) and then Pay, approve the transaction, and you’ve sent 5 USDC on Base Sepolia—done! 🎉 Note: If you have an existing Next.js app, just install the SDK (npm install @base-org/account @base-org/account-ui) and add the component above to your project. For other React frameworks, you can adapt this component as needed.

Next steps

Please Follow the Brand GuidelinesIf you intend on using the SignInWithBaseButton or BasePayButton, please follow the Brand Guidelines to ensure consistency across your application.