Option A — Scaffold a full server in one command (fastest)
npx create-l402-app my-api
This creates a complete Express + l402-kit project: server.ts, .env.example, tsconfig.json, and a /premium endpoint ready to accept Lightning payments.
my-api/ src/server.ts ← your API with l402 middleware .env.example ← Blink/OpenNode credentials template package.json ← npm install l402-kit + tsx tsconfig.json README.md
Then:
cd my-apicp .env.example .env # add your Blink API keynpm installnpm run dev# ⚡ l402-kit server running on http://localhost:3000# curl http://localhost:3000/premium → 402 Payment Required
Not sure? Start with Managed — no node, no account, just a Lightning address. Switch to Soberano in one line of code whenever you want 0% fees. Already-paid tokens keep working after the switch.Get a Lightning address (free, 2 min): Sign up at dashboard.blink.sv — you’ll receive yourname@blink.sv. Or use Alby, Phoenix, or Wallet of Satoshi.Soberano setup: Sign up at dashboard.blink.sv → API Keys → create key → copy your BTC Wallet ID from the wallet page. Set BLINK_API_KEY and BLINK_WALLET_ID in your .env.
You don’t need a Lightning wallet to test your integration. Use a mock provider — it generates valid cryptographic token pairs locally, zero network calls: