-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Complete reference for all plugin configuration options.
// medusa-config.ts
{
resolve: "bitcoin-lightning-payment-module-for-medusajs-via-clink",
id: "clink",
options: {
noffer: "noffer1...", // Required
// ... other options
}
}Type: string
Your CLINK offer string. This is how the plugin communicates with your Lightning node.
How to get it:
- ShockWallet: Receive → CLINK Offer
- Lightning.Pub: Dashboard → Offers
- ZEUS: Settings → CLINK
Format: noffer1qvqsyq...
Type: "coingecko" | "kraken" | "fixed" | "manual"
Default: "coingecko"
Exchange rate source for fiat-to-satoshi conversion.
| Source | API Key Required | Rate Limit | Notes |
|---|---|---|---|
coingecko |
No | 10-50/min | Most popular, free |
kraken |
Optional | 15/min | More accurate |
fixed |
No | None | You set the rate |
manual |
No | None | Enter sats directly |
Example:
currencySource: "kraken"Type: number
Fixed BTC/fiat rate. Only used when currencySource: "fixed".
Example:
currencySource: "fixed",
fixedBtcRate: 65000 // 1 BTC = 65,000 USDType: number
Default: 600 (10 minutes)
Invoice expiry time in seconds. After this time, the invoice is no longer valid.
Valid range: 60 - 86400 (1 minute to 24 hours)
Example:
invoiceTimeout: 300 // 5 minutesType: number
Default: 5000 (5 seconds)
How often to check for payment confirmation (in milliseconds).
Example:
pollInterval: 3000 // Check every 3 secondsType: number
Default: 120
Maximum number of times to poll for payment confirmation.
With default settings: 120 attempts × 5 seconds = 10 minutes (matches invoiceTimeout)
Example:
maxPollAttempts: 60 // Stop after 60 attemptsType: boolean
Default: false
Enable auto-renewal subscriptions via CLINK Debits (nDebit).
Example:
enableSubscriptions: trueType: string
Email address for refund requests. Displayed to customers after payment.
Example:
refundContactEmail: "support@yourstore.com"Type: string
Nostr pubkey for refund requests. Displayed to customers after payment.
Example:
refundContactNostr: "npub1..."Type: boolean
Default: false
Enable detailed logging for troubleshooting.
Example:
debug: trueLogs include:
- Payment initiation
- Currency conversion
- Webhook events
- Errors
{
resolve: "bitcoin-lightning-payment-module-for-medusajs-via-clink",
id: "clink",
options: {
// Required
noffer: "noffer1qvqsyqjqxuurvwpcxc6rvvrxxsurqep5vfjk2wf4v33nsenrxumnyvesxfnrswfkvycrwdp3x93xydf5xg6rzce4vv6xgdfh8quxgct9x5erxvspremhxue69uhhgetnwskhyetvv9ujumrfva58gmnfdenjuur4vgqzpccxc30wpf78wf2q78wg3vq008fd8ygtl4qy06gstpye3h5unc47xmee6z",
// Currency
currencySource: "coingecko",
// Payment
invoiceTimeout: 600,
pollInterval: 5000,
maxPollAttempts: 120,
// Subscriptions
enableSubscriptions: true,
// Refunds
refundContactEmail: "support@mystore.com",
refundContactNostr: "npub1...",
// Debug
debug: false
}
}You can use environment variables for sensitive configuration:
{
noffer: process.env.CLINK_NOFFER,
refundContactEmail: process.env.CONTACT_EMAIL,
debug: process.env.NODE_ENV === "development"
}The plugin validates configuration on startup:
-
noffermust start withnoffer1 -
invoiceTimeoutmust be between 60 and 86400 -
fixedBtcRateis required when usingfixedsource
Invalid configuration will throw an error at startup.
- Subscriptions - Auto-renewal setup
- Currency Sources - Detailed comparison
- Troubleshooting - Common issues