An open API service indexing awesome lists of open source software.

https://github.com/deadcoder0904/btcpayserver-nextjs

btcpayserver example with nextjs
https://github.com/deadcoder0904/btcpayserver-nextjs

Last synced: 5 months ago
JSON representation

btcpayserver example with nextjs

Awesome Lists containing this project

README

          

## btcpayserver-nextjs

## Usage

Install [Node.js](https://nodejs.org/) and [pnpm](https://pnpm.io/).

Use [clovyr.app](https://clovyr.app/)'s free plan (7-day free trial) for [testing BTCPayServer](https://clovyr.app/apps/btcpayserver). Or maybe don't as Clovyr doesn't update BTCPayServer often. Use Voltage Cloud only even for testing because I had a webhook error as Clovyr was using old BTCPayServer version. Or use [kyun host](https://kyun.host) to deploy your own BTCPayServer on a Linux VPS for $15/month.

After testing, you can use Lunanode or [Voltage Cloud's hosted BTCPayServer](https://www.youtube.com/playlist?list=PLuMtKGSqizH2sxmKdy52gdbqSVKkyLX-t) Plan for $8/month or buy a VPS from Kyun Host ($16/month) to self-host it yourself using [btcpayserver-docker](https://github.com/btcpayserver/btcpayserver-docker).

Use [Sparrow Wallet](https://bitcoiner.guide/sparrow/) to test Bitcoin Payments using [testnet](https://www.youtube.com/watch?v=7JJkLW4SHKQ) with [bitcoin testnet faucet](https://coinfaucet.eu/en/btc-testnet/).

### .env.development

```bash
NODE_ENV=development
NEXT_PUBLIC_BASE_URL=http://localhost:3000

# BTCPayServer Testnet Keys
# Go to `Account > Manage Account > API Keys under Account Settings > Generate API Key > Give Permissions btcpay.store.canviewinvoices & btcpay.store.cancreateinvoice`
BTCPAY_API_KEY=xxxx
# Root URL in Web Browser suffixed with `/api/v1`
BTCPAY_URL=/api/v1
# Create Store (or select already existing Store) & go to `Settings` to find `Store ID` under `Store Settings > General`
BTCPAY_STORE_ID=xxxx
# Under `Settings > Store Settings > Webhooks` => Payload URL = http://localhost:3000/api/btcpayserver/webhook (replace http://localhost:3000 with ngrok url as localhost (specifically, http) won't work with webhooks) & Events > Send Me Everything
BTCPAY_WEBHOOK_SECRET=xxxx

NEXT_PUBLIC_EBOOK_PRICE=107

NEXT_TELEMETRY_DISABLED=1
```

Run `pnpm dev` (or `pnpm turbo`) in one terminal and `pnpm ngrok:listen` in another terminal. `ngrok` is needed for webhooks as webhooks don't work on http, they need https.

> Make sure to set up [ngrok](https://ngrok.com) with [static domain](https://ngrok.com/blog-post/free-static-domains-ngrok-users).