Bitcoin Lightning payment module for Medusa eCommerce via the CLINK protocol
Bitcoin Lightning payment module for MedusaJS eCommerce via the CLINK protocol.
| Component | Description |
|---|---|
| Core payment provider with CLINK SDK integration | |
| Fiat-to-sats conversion (CoinGecko, Kraken, Fixed, Manual) | |
| Recurring payments via nDebit protocol | |
| Admin Settings Widget | Configure noffer, currency source, subscriptions, refunds |
| Storefront Component | QR code + copy + countdown timer + payment status polling |
| Webhook Endpoint | Real-time payment confirmations from CLINK relay |
| Status Endpoint | Backup polling for payment verification |
npm install medusa-plugin-bitcoin-lightning-via-clinkAdd to your :
1import { Modules } from "@medusajs/framework/utils"2
3module.exports = defineConfig({4 modules: [5 {6 resolve: "@medusajs/medusa/payment",7 options: {8 providers: [9 {10 resolve: "medusa-plugin-bitcoin-lightning-via-clink",11 id: "clink",12 options: {13 noffer: "noffer1...", // Your CLINK offer string14 currencySource: "coingecko",15 invoiceTimeout: 600,16 debug: false17 }18 }19 ]20 }21 }22 ]23})Customers can now pay with Lightning at checkout.
Full documentation lives on the GitHub Wiki:
1┌─────────────────────────────────────────────────────────────────┐2│ CHECKOUT FLOW │3├─────────────────────────────────────────────────────────────────┤4│ │5│ Customer selects "Pay with Lightning" │6│ │ │7│ ▼ │8│ Medusa requests invoice │9│ │ │10│ ▼ │11│ CLINK SDK decodes nOffer → requests BOLT11 from your node │12│ │ │13│ ▼ │14│ QR code + invoice displayed to customer │15│ │ │16│ ▼ │17│ Customer scans QR with Lightning wallet │18│ │ │19│ ▼ │20│ Payment confirmed via Webhook (primary) OR Polling (backup) │21│ │ │22│ ▼ │23│ Order confirmed! ⚡ │24│ │25└─────────────────────────────────────────────────────────────────┘No web server needed for your Lightning node. All communication flows over Nostr. See the Wiki architecture page for the full data flow.
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Your CLINK offer string | |
| string | No | Exchange rate source | ||
| number | No | - | Fixed BTC rate (if using source) | |
| number | No | Invoice expiry in seconds | ||
| number | No | Polling interval in ms | ||
| boolean | No | Enable nDebit subscriptions | ||
| string | No | - | Merchant email for refunds | |
| string | No | - | Merchant Nostr for refunds | |
| boolean | No | Enable debug logging |
See the Configuration Wiki page for details on each option.
For Merchants (to get your ):
For Customers (to pay):
1# Install dependencies2npm install3
4# Run tests5npm test6
7# Build8npm run build9
10# Watch mode11npm run devContributions are welcome! Please see CONTRIBUTING.md for details.
GPL-3.0 - See LICENSE for details.