Skip to main content

Template Gallery

Six starter templates, each a complete Next.js app on Pepe Unchained V2 mainnet (chain 97741) built on @pepu-chain/sdk. This page shows which pillars each one demonstrates, what each needs, and how to pick. It is derived from packages/create-pepu-app/src/templates.json and the SDK's TEMPLATE_REQUIREMENTS.

The six starter templates with the pillars each includes: consumer-app, token-gated-app, nft-mint, game-app, sponsored-demo and sponsored-session-app

Six templates, from a first login to the full stack.

Each template README lists its setup. The sponsorship templates use the hosted bundler and paymaster but need a funded project of yours (claim, deposit, token).

Prerequisites​

  • Node.js 18 or newer.
  • A Privy app (App ID and App Secret) from dashboard.privy.io. Every template needs one. See Privy Setup Walkthrough.
  • A little PEPU in the wallet for templates where the user pays gas.
TemplateWhat it showsDifficultyPillars
consumer-appSign in, get an embedded wallet, send native PEPUstarterGoogle to wallet
token-gated-appUnlock content by holding an ERC-20 or NFT, balances batched through Multicall3starterGoogle to wallet
nft-mintAn ERC-721 mint page plus the Foundry and Hardhat contractintermediateGoogle to wallet
game-appGrant a session once, then play with no wallet popup per moveadvancedGoogle to wallet, session keys
sponsored-demoA zero-balance smart account taps on-chain, the paymaster paysadvancedGoogle to wallet, sponsored transactions
sponsored-session-appGoogle or email sign-in, one on-chain session, then actions with no popup and no user gasadvancedAll three, combined

Pillar matrix​

The three core pillars and their combination. "Login" means Privy login with a server-provisioned embedded wallet; Google is one of the login methods and is required by sponsored-session-app.

TemplateGoogle to walletSession keysSponsored transactionsCombination
consumer-appYesNoNoNo
token-gated-appYesNoNoNo
nft-mintYesNoNoNo
game-appYesYes, Privy session signer (off-chain scope, user pays gas)NoNo
sponsored-demoYesNoYes, Privy Smart Wallets transportNo
sponsored-session-appYesYes, on-chain Kernel session keyYes, direct bundler and paymasterYes

See The Three Pillars and How They Combine.

Env needs at a glance​

TemplateRequiredOptionalExtra setup
consumer-appNEXT_PUBLIC_PRIVY_APP_ID, PRIVY_APP_SECRETnonenone
token-gated-appNEXT_PUBLIC_PRIVY_APP_ID, PRIVY_APP_SECRET, and at least one of NEXT_PUBLIC_GATE_ERC20_ADDRESS or NEXT_PUBLIC_GATE_ERC721_ADDRESSthe two gate addressesnone
nft-mintNEXT_PUBLIC_PRIVY_APP_ID, PRIVY_APP_SECRET, NEXT_PUBLIC_NFT_CONTRACT_ADDRESSnoneDeploy the contract in contracts/ first
game-appNEXT_PUBLIC_PRIVY_APP_ID, PRIVY_APP_SECRET, NEXT_PUBLIC_PRIVY_KEY_QUORUM_ID, PRIVY_AUTHORIZATION_KEY, NEXT_PUBLIC_GAME_CONTRACT_ADDRESSSESSION_DURATION_MINUTES, PEPU_RPC_URLGenerate and register the authorization key, deploy TapScore
sponsored-demoNEXT_PUBLIC_PRIVY_APP_ID, PRIVY_APP_SECRETNEXT_PUBLIC_PAYMASTER_CONTRACT_ADDRESSEnable Smart Wallets in the Privy dashboard with https://bundler.pepeunchained.com and https://paymaster.pepeunchained.com/v2/paymaster/<project token>
sponsored-session-appNEXT_PUBLIC_PRIVY_APP_ID, PRIVY_APP_SECRET, PEPU_PAYMASTER_URL (hosted URL with your project server key)PEPU_BUNDLER_URL (defaults to the hosted bundler), SESSION_DURATION_MINUTES, PEPU_RPC_URLA claimed and funded paymaster project of your own

Privy dashboard settings at a glance​

Settingconsumertoken-gatednft-mintgamesponsored-demosponsored-session
A login method enabledRequiredRequiredRequiredRequiredRequiredRequired
Google login enabledRequired
Allowed origin with exact port (http://localhost:3000)RequiredRequiredRequiredRequiredRequiredRequired
Embedded wallets enabledRequiredRequiredRequiredRequiredRequiredRequired
Authorization key and key quorumRequired
Smart Wallets (chain 97741, Kernel, bundler and paymaster URLs)RequiredNot needed: it builds its own Kernel account

Field-by-field instructions: Dashboard Settings, Field by Field.

Choosing a template​

If you wantUse
Your first app: login, wallet, sendconsumer-app
Holder-only content, communities, perkstoken-gated-app
A mint page for your own collectionnft-mint
Many fast actions with no popup, and your users pay gasgame-app
To see sponsorship work, or build gasless sends on Privy Smart Walletssponsored-demo
The full stack: Google or email sign-in, session key, no popup, no user gassponsored-session-app

Rules of thumb:

  • Start with consumer-app unless you need a specific pillar. The other starters share its login and wallet code.
  • If your users must never pay gas you need a funded paymaster project; the bundler and paymaster are hosted by PEPU. The free tier is only for PEPU's own Privy app.
  • game-app and sponsored-session-app solve the same popup problem with different trust models. game-app: Privy enforces the scope off-chain and the user pays gas. sponsored-session-app: the chain enforces the scope and a paymaster pays. See Session Keys and Sponsored Session.

Scaffold one​

npx create-pepu-app@latest my-app --template <name>

Add --yes to skip prompts. Every flag, the --json output and the vendored-SDK note are in create-pepu-app CLI.

Then, in every template:

cd my-app
npm install # or pnpm install, yarn, bun install
npm run doctor # checks .env.local against the template's requirements; prints no values
npm run dev # http://localhost:3000

Run on port 3000. Privy's allowed origins match the exact origin including the port, and Next.js silently falls back to 3001 when 3000 is taken, which breaks login.

What every template shares​

  • The SDK is the source for chain, addresses, providers, wallet provisioning and explorer links. Nothing redefines a chain, RPC URL or address.
  • Mainnet only. No network switch.
  • In the wagmi-based templates (consumer, token-gated, nft-mint, game), the embedded wallet is pinned as the active account (useActiveWalletPin), so a browser extension cannot silently become the sender.
  • A setup screen that lists what is missing in most templates, so the app runs before you configure it.
  • A gas notice. No template calls a transaction free or gasless unless a paymaster paid it.
  • The shared PEPU design system and the agent kit (AGENTS.md, CLAUDE.md, editor configs). See AGENTS.md and CLAUDE.md in Templates.

Common failures​

SymptomCauseFix
Login fails with a CSP or 403 errorThe app is on port 3001, or the origin is not allowedFree port 3000, or add the exact origin to Allowed origins in Privy.
The app shows a setup screenRequired env vars are blankRun npm run doctor and set the keys it lists.
A sponsorship template spins on "Setting up your smart wallet" or denies a sendNo paymaster token configured, or the project is unfunded or unclaimedSet the paymaster URL with your project token (https://paymaster.pepeunchained.com/v2/paymaster/<token>) and run pepu_sponsorship_status.