OpenReceive for TanStack Start
Accept Bitcoin & Stablecoin Payments With TanStack Start
OpenReceive has no TanStack Start package, and needs none. One server route hands each request to OpenReceive's web-standard handler, on Node or on Cloudflare Workers. It is the stack Lovable builds, and on Supabase the payments go through Supabase's HTTPS API.
Recipe
Read the TanStack Start recipe
Why OpenReceive
- No OpenReceive account. There is no sign-up, no API key and no dashboard. Install the package, add a receive-only wallet code, and your server issues invoices itself.
- Open source, inside your server. MIT-licensed routes mount in the app you already run. OpenReceive never sees an order, a price or a customer, and never holds funds.
- Receive-only wallet permissions. The one credential is a receive-only NWC code. It can create invoices and read their status. It cannot spend, so a compromised server cannot drain the wallet.
- Stablecoins, optional. Connect a swap provider and customers can pay in USDT, USDC, ETH or SOL. Every payment still settles to your wallet in Bitcoin.
Try the checkout your customers will see
The live demo needs JavaScript: open the OpenReceive home page.
Set up
Requires Node ≥ 22, or Cloudflare Workers with Node compatibility.
1. Get a receive-only NWC code — get one here. It can issue invoices and watch for payment, and it can never spend from your wallet.
2. Get an LSC code for swaps (optional) — from a swap provider, only if customers should be able to pay in USDT, USDC, ETH or SOL.
3. Set the environment variables — NWC_URI (required) and
LSC_URI_PRIMARY / LSC_URI_BACKUP (optional) in the environment of
your TanStack Start server process; see
Environment variables.
4. Install
npm install @openreceive/http @openreceive/react pg
5. Follow the recipe — Add the payment route and the checkout page. The recipe has the code, the database tables and the settings.
Read the TanStack Start recipe
How it runs
- Tested on
- Cloudflare Workers (workerd), checked with TanStack Start 1.168 and OpenReceive 0.4.19; CI runs its Supabase route as a Worker
- Databases
- PostgreSQL through a transaction pooler, or Supabase over its HTTPS API
- Secrets
- NWC_URI, and LSC_URI_PRIMARY for swaps, as server secrets (Worker secrets on Cloudflare), never with a VITE_ prefix
- Refunds
- Refund a settled Lightning payment from your own wallet: the wallet code is receive-only. A swap deposit that never converted goes back to the payer through the checkout's refund form.
- Mobile apps
- No app SDK. A mobile app opens your checkout page in a browser tab, which the app stores allow for physical goods and real-world services; digital goods need a link-out program.
Practical questions
- Which currencies can customers pay with?
- Bitcoin over Lightning, always. With a swap provider configured, also USDT on Tron, Solana or Ethereum, USDC on Solana or Ethereum, ETH and SOL, each converted into the same Lightning payment. Automated swaps guide
- Where does the Bitcoin go?
- Into the wallet behind your NWC code. OpenReceive never holds funds: the invoice is minted in your wallet and the sats land there. Your server confirms settlement and runs your onPaid hook once per order. Payment storage guide
- What wallet do I need?
- Any wallet that issues receive-only NWC (Nostr Wallet Connect) codes, hosted or self-run. The code must be able to create invoices and read their status, and must not be able to spend. Get a receive-only NWC code
- What does it cost?
- OpenReceive is open source and free. Fees charged by your wallet provider, by a swap provider or by Lightning routing belong to those services and are outside OpenReceive's scope.
- What do I need to deploy?
- Node 22 or later, or Cloudflare Workers with Node compatibility; a Postgres database or Supabase; NWC_URI as a server secret; and OpenReceive's two payment tables. TanStack Start recipe