Environment Variables
Lightning Enable is a hosted SaaS. The API at api.lightningenable.com is deployed and operated by Lightning Enable — as a merchant you never run the server or set its server-side configuration. Your setup happens in the dashboard and via the merchant API.
This page covers two audiences:
- For merchants — environment variables for the open-source MCP server that you run on your own machine so AI agents can pay over Lightning.
- Platform operator reference — server-side settings used by Lightning Enable staff to operate the hosted platform. Documented for transparency; merchants never set these.
For merchants: MCP server configuration
The MCP (Model Context Protocol) server enables AI agents to use Lightning Enable tools. It runs locally (or wherever your agent runs) and is configured entirely through environment variables and a local config file — none of this touches the hosted platform.
Wallet Configuration
The MCP server is open-source (MIT) and free to install. Wallet, invoice, L402, budget, and API-discovery tools work out of the box with just a wallet configured below. Producer tools (sell access via L402) and Agent Service Agreement tools (agent-to-agent commerce over Nostr) unlock with a Lightning Enable API key. See the MCP Complete Guide for the full tool list.
Choose one wallet provider (listed in default priority order):
LND (Best for L402):
LND_REST_HOST=https://your-lnd-node:8080
LND_MACAROON_HEX=your-admin-macaroon-hex
Nostr Wallet Connect (NWC):
NWC_CONNECTION_STRING=nostr+walletconnect://pubkey?relay=wss://relay.example.com&secret=xxx
Strike (Recommended for USD users):
STRIKE_API_KEY=your-strike-api-key
OpenNode:
OPENNODE_API_KEY=your-opennode-api-key
OPENNODE_ENVIRONMENT=production # or "dev" for testnet
If multiple wallet credentials are configured, they are used in this order:
- LND (if
LND_REST_HOSTandLND_MACAROON_HEXare set) - NWC (if
NWC_CONNECTION_STRINGis set) - Strike (if
STRIKE_API_KEYis set) - OpenNode (if
OPENNODE_API_KEYis set)
This order prioritizes wallets that return a preimage, which is required for L402. OpenNode does not return preimages, so L402 will not work with it. You can override the priority with the WALLET_PRIORITY environment variable (values: lnd, nwc, strike, opennode).
Only the first configured wallet is used.
Spending Limits Configuration
Budget limits are configured via ~/.lightning-enable/config.json:
{
"currency": "USD",
"tiers": {
"autoApprove": 0.10,
"logAndApprove": 1.00,
"formConfirm": 10.00,
"urlConfirm": 100.00
},
"limits": {
"maxPerPayment": 500.00,
"maxPerSession": 100.00
}
}
This file is created automatically on first run. AI agents cannot modify this file. At runtime, an agent can tighten its own caps via the configure_budget tool, but it can never raise them above the limits in this file.
See AI Spending Security for detailed configuration.
MCP Configuration Summary
| Variable | Required | Default | Description |
|---|---|---|---|
LND_REST_HOST | If using LND | - | LND REST API host |
LND_MACAROON_HEX | If using LND | - | LND admin macaroon in hex |
NWC_CONNECTION_STRING | If using NWC | - | Nostr Wallet Connect URI |
STRIKE_API_KEY | If using Strike | - | Strike API key (preferred for USD) |
OPENNODE_API_KEY | If using OpenNode | - | OpenNode API key with withdrawal permissions |
OPENNODE_ENVIRONMENT | No | production | production or dev |
WALLET_PRIORITY | No | - | Override default wallet priority (lnd, nwc, strike, or opennode) |
LIGHTNING_ENABLE_API_KEY | No | - | Merchant API key; required by the producer tools and the ASA request/publish tools (discovery/settlement/reputation work without it) |
The MCP server is open-source (MIT) and free to install. Wallet, invoice, L402, budget, and API-discovery tools work out of the box with just a wallet — no account or API key required. Producer tools (sell access via L402) and the ASA request/publish tools unlock with a Lightning Enable API key; ASA discovery, settlement, and reputation reads work with just a wallet. See the MCP Complete Guide for the full tool list.
Your Strike or OpenNode API key for accepting payments through Lightning Enable is configured in the dashboard (Settings → Payment Provider) or via the merchant API (PUT /api/merchant/strike-key / PUT /api/merchant/opennode-key) — never through environment variables. The STRIKE_API_KEY / OPENNODE_API_KEY variables above configure the MCP server's outgoing wallet only.
Platform operator reference (Lightning Enable staff)
Lightning Enable is hosted SaaS — everything below configures the platform itself and is managed by Lightning Enable staff on the production deployment. It is documented here for transparency and for internal operations. If you are a merchant, nothing in this section applies to you.
Required Configuration
Database Encryption Key
DB_ENCRYPTION_KEY=your-base64-encoded-32-byte-key
Purpose: Encrypts sensitive fields (API keys, provider keys) at rest using AES-256-GCM.
Generate a secure key:
# Linux/Mac
openssl rand -base64 32
# PowerShell
[Convert]::ToBase64String((1..32 | ForEach-Object { Get-Random -Maximum 256 }))
- BACKUP THIS KEY - If lost, all encrypted merchant data is permanently unrecoverable
- NEVER CHANGE after deployment - existing encrypted data becomes unreadable
Admin API Key
ADMIN_API_KEY=your-secure-admin-key
Purpose: Authenticates internal admin API requests and Hangfire dashboard access for platform operators. Not used by merchants.
Recommended: Generate using the same method as DB_ENCRYPTION_KEY.
Database Connection
ConnectionStrings__DefaultConnection="Server=your-server;Database=LightningEnable;..."
Purpose: SQL Server connection string for the application database.
For Azure SQL with Entra ID authentication:
Server=your-server.database.windows.net;Database=LightningEnable;Authentication=Active Directory Managed Identity;
Stripe Configuration
All Stripe settings are required for subscription management.
Secret Key
Stripe__SecretKey=sk_live_xxxxxxxxxxxxx
Purpose: Server-side Stripe API authentication.
- Production: Use
sk_live_...keys - Development: Use
sk_test_...keys
Publishable Key
Stripe__PublishableKey=pk_live_xxxxxxxxxxxxx
Purpose: Client-side Stripe Checkout initialization.
Webhook Secret
Stripe__WebhookSecret=whsec_xxxxxxxxxxxxx
Purpose: Verifies webhook signatures from Stripe.
Get this from: Stripe Dashboard → Webhooks → Select endpoint → Signing secret
Base URL
Stripe__BaseUrl=https://api.lightningenable.com
Purpose: Base URL for success/cancel redirect URLs after checkout.
Pricing Plans
{
"Stripe": {
"PricingPlans": {
"individual": {
"Name": "Agentic Commerce — Individual",
"Description": "Full L402 access for individual developers",
"PriceId": "price_xxxxxxxxxxxxx",
"PriceCents": 9900,
"TrialEligible": true,
"Features": [
"Full REST API access",
"L402 protocol support",
"Pay-per-request billing"
]
},
"standaloneapi": {
"Name": "Standalone API (Legacy)",
"Description": "Full L402 access for individual developers",
"PriceId": "price_xxxxxxxxxxxxx",
"PriceCents": 9900,
"Features": ["Full REST API access", "L402 protocol support"]
},
"kenticocommerce": {
"Name": "Kentico Commerce",
"Description": "Native Xperience by Kentico integration",
"PriceId": "price_xxxxxxxxxxxxx",
"PriceCents": 24900,
"TrialEligible": false,
"Features": ["Everything in Individual plan", "Xperience by Kentico integration"]
},
"l402": {
"Name": "Agentic Commerce — Business",
"Description": "Pay-per-request API monetization",
"PriceId": "price_xxxxxxxxxxxxx",
"PriceCents": 29900,
"TrialEligible": true,
"Features": ["Everything in Individual plan", "L402 protocol support", "Pay-per-request billing"]
}
}
}
}
Purpose: Maps product tiers to Stripe pricing. Each key (individual, standaloneapi, kenticocommerce, l402) maps to an object — not a bare price-ID string — with Name, Description, PriceId, PriceCents, an optional TrialEligible (a bool that defaults to false when omitted — e.g. standaloneapi above omits it), and a Features array.
Note — these keys are checkout-selection identifiers, not the stored
Merchant.PlanTiervalue. The checkout flow looks up aPriceIdby this key (StripeSettings.GetPriceId), and the Stripe webhook then derives the tier that's persisted toMerchant.PlanTierfrom the PriceId viaPlanTierService.GetTierFromStripePriceId— not from this key. That's why a couple of keys differ from their resulting tier ID:standaloneapi→ tierstandalone,kenticocommerce→ tierstandard. So the keys above are correct as written; they don't need to match thePlanTierServicetier IDs.
Payment Provider Configuration
Lightning Enable supports multiple payment providers. These settings control the platform-wide defaults; each merchant supplies their own provider API key via the dashboard or merchant API.
Default Provider
PaymentProvider__Default=Strike
Values: Strike (default) or OpenNode
This sets the default provider for merchants that don't have an explicit provider configured. Per-merchant provider selection is available via the merchant settings API.
Strike Configuration
PaymentProvider__Strike__BaseUrl=https://api.strike.me/v1
| Setting | Default | Description |
|---|---|---|
PaymentProvider:Strike:BaseUrl | https://api.strike.me/v1 | Strike API base URL. Use https://api.dev.strike.me/v1 for sandbox. Platform-wide — not selectable per merchant. |
Merchants configure their Strike API key via the merchant settings API. The key is encrypted at rest using AES-256-GCM.
| Feature | Strike | OpenNode |
|---|---|---|
| Invoice creation | 2-step (create + quote) | Single step |
| Preimage support | Direct from API | Parsed from BOLT11 |
| Native refunds | No (uses payment-quotes) | Yes |
| Webhook format | Thin (entityId only) | Full payload |
| Currencies | BTC, USD, EUR, GBP | BTC, USD |
| Best for | L402, general payments | Refund-heavy workflows |
OpenNode Environment
OpenNode__Environment=production
Values:
dev- Uses https://dev-api.opennode.com (testnet Bitcoin)production- Uses https://api.opennode.com (mainnet Bitcoin)
Platform-wide — the hosted platform runs against OpenNode production, so merchants use production OpenNode API keys.
Webhook URL (Optional)
PaymentProvider__WebhookUrl=https://api.lightningenable.com/api/webhooks/opennode
Purpose: Override auto-detected webhook URL. Used as the callback URL for all payment providers (OpenNode and Strike).
Auto-detection order:
PaymentProvider:WebhookUrlfrom config (if set)WEBSITE_HOSTNAMEenvironment variable (Azure App Service)APP_URLenvironment variable (custom deployment)localhost:5096(local development fallback)