create-fedi-app

npx create-fedi-app@latest

Build on Fedi.

Scaffold a Next.js mini app with WebLN, Nostr, and Fedi browser APIs wired in. Optional Lightning, AI, and database modules included.

terminal
$ create-fedi-app@latest
Read the docsMIT licensed · open source

What it gives you

Every generated project ships with these. No extra prompts.

webln-payments
React hooks and a mock provider for window.webln. Send payments, create invoices, and sign messages with graceful fallbacks outside Fedi.
nostr-identity
NIP-07 connection layer with getPublicKey, signEvent, and relay access. Works in Fedi and degrades cleanly in a normal browser.
ecash-balance
Reads ecash balance via window.fediInternal and surfaces the Fedi-specific APIs your mini app runs inside.
@create-fedi-app/ui
Fedi-themed shadcn primitives: SatsAmount, ConnectionBadge, MiniAppLayout, and safe-area helpers sized for mobile WebView.
dev-toolbar
Toggle mock WebLN and Nostr providers in development so you can build without opening Fedi on every refresh.
next.js 16
App Router, TypeScript strict mode, Tailwind v4, and env validation via @t3-oss/env-nextjs. Production defaults, not a toy starter.

Six prompts to a working app

Pick your database, toggle optional modules, choose a package manager. Defaults are sensible. Most scaffolds finish in under a minute.

  • WebLN, Nostr, and ecash modules always included
  • Dependencies resolve automatically per module
  • AI rules directory optional for Cursor and Claude Code
create-fedi-app
$ npx create-fedi-app@latest   Project name│  my-fedi-app  Database│  ● None (no persistence layer)│  ○ Turso│  ○ Supabase  Optional modules (space to toggle)│  ◻ payment-gated-content│  ◻ lnurl│  ◻ ai-chat-gated│  ◻ ai-assistant│  ◻ multispend-demo│  ◻ nostr-feed│  ◻ database  Include AI rules directory (.cursorrules / CLAUDE.md)?│  Yes  Package manager│  ● bun│  ○ pnpm│  ○ npm└  Created my-fedi-app   Next: cd my-fedi-app && bun install && bun dev

Optional modules

Toggle at scaffold time. Each module merges templates, routes, and env vars into your project.

  • payment-gated-contentwebln-payments

    Lock pages or assets behind a Lightning invoice. HMAC-signed access cookies after payment.

  • lnurlstandalone

    LNURL-pay, LNURL-auth, and LNURL-withdraw flows with callback routes wired up.

  • ai-chat-gatedwebln-payments

    Streaming AI chat where each message costs sats. Invoice route plus WebLN payment before streamText runs.

  • ai-assistantstandalone

    Free-form AI assistant using Vercel AI SDK. Provider-agnostic: Anthropic, OpenAI, Groq, or Ollama.

  • multispend-demonostr-identity

    UI walkthrough of Fedi threshold spending: proposals, Nostr-signed approvals, mock execution.

  • nostr-feednostr-identity

    Subscribe to kind:1 notes, publish events, and optional zap receipts over WebLN.

  • databasestandalone

    Drizzle ORM CRUD example. Choose Turso (libSQL) or Supabase at scaffold time.

  • ai-rulesstandalone

    Generates .cursorrules and CLAUDE.md with Fedi API context for AI-assisted development.

How Fedi works

Fedi is a Bitcoin wallet built on Fedimint, a federated e-cash system. Mini apps run inside Fedi's in-app browser, where the host injects window.webln: a WebLN provider for Lightning payments, invoices, and message signing without leaving your app.

The same browser exposes window.nostr for NIP-07 identity and window.fediInternal for ecash balance and federation APIs. Outside Fedi, these objects are undefined. Your code must detect them and degrade gracefully.

Fedi in-app browserinjectswindow.weblnLightning paymentswindow.nostrNIP-07 identitywindow.fediInternalEcash & federationyour mini app