Skip to content

Build Onchain Apps with OnchainKit ⛵️ 🌊

Build your first onchain app effortlessly with OnchainKit's app template. Save weeks of initial setup and easily integrate onchain components with web2 infrastructure.

Our opinionated approach streamlines early decisions, making your development process smoother.

Whether you're a hackathon participant or an ambitious entrepreneur aiming to build the next big thing, this template is tailored for you.

Build Onchain Apps with OnchainKit

Play with it live here.

Out of the box

  • Next.js v14 with App routing 🏗️
  • Ethereum L2 support through Base 🔵
  • Easy account creation with Smart Wallet
  • Live examples for Minting and Paymaster experiences with wagmi and Viem 🚀
  • Latest styling best practices with Tailwind CSS 💅
  • Easy maintenance with linting, formatting, and tests ✅

Getting Started

Fork the repo

Go to https://github.com/coinbase/onchain-app-template and click on the "Use this template" button to create a new repository based on the template.

Use OnchainKit template

Public API Key(s)

Obtain a Public API Key from the Coinbase Developer Platform APIs.

OnchainKit copy Public API Key

In order to use RainbowKit, you'd also need to obtain a Wallet Connector project ID at WalletConnect.

Create a .env file

Create a new file in your project’s root directory and name it .env.

OnchainKit define Public API Key
.env
NEXT_PUBLIC_CDP_API_KEY=YOUR_PUBLIC_API_KEY
NEXT_PUBLIC_WC_PROJECT_ID=YOUR_WALLETCONNECT_PROJECT_ID

Install dependencies

In your new onchain app repository, run the following commands to install the dependencies:

# Install bun in case you don't have it
bun curl -fsSL <https://bun.sh/install> | bash
 
# Install packages
bun i

Run the app

Now you are ready to run the app and start building onchain experiences!

# Run Next app
bun run dev

Need more help?

If you have any questions or need help, feel free to reach out to us on Discord or open a Github issue or DMs us on X at @onchainkit, @zizzamia, @fkpxls.