A production-ready Next.js starter template for building dApps with Privy embedded wallets, featuring multi-chain support and modern Web3 tooling.
- Privy Authentication - Seamless login with embedded wallets
- Multi-chain Support - Pre-configured for MegaETH and RISE testnets
- Modern Stack - Next.js 15, TypeScript, Tailwind CSS
- Wagmi and Viem - Wagmi + Viem pre-configured
- Sleek UI - Dark/light theme with responsive design
- Chain Switching - Easy network switching functionality
- Transaction Examples - Send transactions and contract interactions
- Ready to Deploy - Optimized for production deployment
- Node.js 18+
- A Privy account and App ID
- In your Privy dashboard, go to your app, then click on Authentication (under User Management) → Advanced → Tick "Disable confirmation modals"
-
Clone this repository
# This project was created with create-privy-embedded-app # cd my-privy-app
-
Install dependencies
npm install # or pnpm install # or yarn install
-
Set up environment variables
cp .env.example .env.local
Add your Privy App ID to
.env.local
:NEXT_PUBLIC_PROJECT_ID=your_privy_app_id_here
-
Run the development server
npm run dev
-
Open http://localhost:3000 in your browser
By default, this starter supports:
- MegaETH Testnet - High-performance Ethereum L2
- RISE Testnet - Next-generation blockchain network
-
Update
src/wagmi-config/index.tsx
:import { yourNewChain } from 'viem/chains' export const wagmiConfig = createConfig({ chains: [megaethTestnet, riseTestnet, yourNewChain], transports: { [yourNewChain.id]: http(), }, })
-
Update the Privy config in
src/context/index.tsx
:supportedChains: [megaethTestnet, riseTestnet, yourNewChain]
The starter includes example contract interactions. Update contract addresses in src/constants/index.ts
for your own contracts.
src/
├── app/ # Next.js app directory
├── components/ # Reusable UI components
├── constants/ # Contract addresses and ABIs
├── context/ # Privy and provider setup
├── lib/ # Utility functions
└── wagmi-config/ # Wagmi configuration
- Authentication Flow - Login/logout with Privy
- Wallet Management - Embedded wallet creation and connection
- Balance Display - Real-time balance updates
- Chain Switching - Switch between supported networks
- Transaction Examples:
- Send ETH transactions
- Smart contract interactions
- Transaction status tracking
- Responsive Design - Mobile-friendly interface
- Theme Support - Dark/light mode toggle
- Built with Tailwind CSS - modify
tailwind.config.js
- Theme system with
next-themes
- Component library setup ready for shadcn/ui
- Wagmi configuration in
src/wagmi-config/
- Viem for low-level Ethereum interactions
- Easy to extend with additional chains
- Push your code to GitHub
- Connect your repo to Vercel
- Add your environment variables in Vercel dashboard
- Deploy!
This starter works on any platform that supports Next.js:
- Netlify
- Railway
- Render
- AWS Amplify
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.