Skip to content

Notifications

LNbits can send server-level notifications through multiple channels - email (SMTP), Telegram, Nostr DM, and web push (PWA).

Notifications alert admins about important server events like payments, balance changes, settings updates, and server status. Configure one or more channels in the Admin Dashboard or via environment variables.

Video Tutorial

Available channels

ChannelHow it worksGood for
Email (SMTP)Sends email via your SMTP serverFormal alerts, audit trails
TelegramSends messages to a Telegram chat via botQuick mobile alerts
Nostr DMSends encrypted direct messages on NostrPrivacy-focused, decentralized
Web PushBrowser and PWA push notificationsEnd-user payment alerts

You can enable multiple channels at once. Each operates independently.

Notification triggers

Each trigger can be toggled individually in Admin Dashboard > Server > Notifications.

TriggerDescriptionThreshold / interval
Settings updatedNotify when server settings have been updatedOn/off toggle
Credit / DebitNotify when a wallet has been credited or debited by the Super UserOn/off toggle
Server Start/StopNotify when the server has been started or stoppedOn/off toggle
Balance Delta ChangedNotify when the difference between node balance and LNbits balance has changed by more than the specified amount (sats). Runs every minute. Set to 0 to disable.Sats threshold
Watchdog LimitNotify when the watchdog limit has been reached. Does not affect the funding source.On/off toggle
Server StatusSend regular notifications about server status (account count, wallet count, payment stats)Interval in hours (e.g. 24)
Incoming PaymentsNotify when a wallet has received a payment above the specified amountSats threshold (e.g. 1000000)
Outgoing PaymentsNotify when a wallet has sent a payment above the specified amountSats threshold

Trigger environment variables

bash
# On/off toggles
LNBITS_NOTIFICATION_SETTINGS_UPDATE=true
LNBITS_NOTIFICATION_CREDIT_DEBIT=true
LNBITS_NOTIFICATION_SERVER_START_STOP=true
LNBITS_NOTIFICATION_WATCHDOG=true

# Sats thresholds (set to 0 to disable)
NOTIFICATION_BALANCE_DELTA_THRESHOLD_SATS=1
LNBITS_NOTIFICATION_INCOMING_PAYMENT_AMOUNT_SATS=1000000
LNBITS_NOTIFICATION_OUTGOING_PAYMENT_AMOUNT_SATS=0

# Intervals
LNBITS_NOTIFICATION_SERVER_STATUS_HOURS=24
LNBITS_WATCHDOG_INTERVAL_MINUTES=60

TIP

The Balance Delta trigger compares LNbits internal accounting against the actual Lightning node balance. If they drift apart, you get an alert. This catches issues like payments settling on the node but not being recorded in LNbits.

Channel configuration

All settings are available in Admin Dashboard > Server > Notifications, or via .env variables.

Email (SMTP)

bash
LNBITS_EMAIL_NOTIFICATIONS_ENABLED=true
LNBITS_EMAIL_NOTIFICATIONS_EMAIL=sender@example.com
LNBITS_EMAIL_NOTIFICATIONS_SERVER=smtp.example.com
LNBITS_EMAIL_NOTIFICATIONS_PORT=587
LNBITS_EMAIL_NOTIFICATIONS_USERNAME=user@example.com
LNBITS_EMAIL_NOTIFICATIONS_PASSWORD=your-password
LNBITS_EMAIL_NOTIFICATIONS_TO_EMAILS=admin@example.com,backup@example.com

Telegram

bash
LNBITS_TELEGRAM_NOTIFICATIONS_ENABLED=true
LNBITS_TELEGRAM_NOTIFICATIONS_ACCESS_TOKEN=123456:ABC-DEF...
LNBITS_TELEGRAM_NOTIFICATIONS_CHAT_ID=-1001234567890

To get these values:

  1. Create a bot via @BotFather on Telegram
  2. Copy the bot token
  3. Add the bot to your group or start a DM with it
  4. Get the chat ID (use @userinfobot or the Telegram API)

Nostr DM

bash
LNBITS_NOSTR_NOTIFICATIONS_ENABLED=true
LNBITS_NOSTR_NOTIFICATIONS_PRIVATE_KEY=nsec1...
LNBITS_NOSTR_NOTIFICATIONS_IDENTIFIERS=npub1...,npub1...

The private key is used to send encrypted DMs. The identifiers are the recipient npubs who receive the notifications. You can list multiple recipients separated by commas.

Web Push (PWA)

Web push notifications work automatically for users who have installed LNbits as a Progressive Web App. No environment variables needed - VAPID keys are generated and stored in the database automatically.

Users receive push notifications for incoming payments on their wallets.

WARNING

Web push notifications do not work in incognito/private browsing mode.

How it works internally

  1. Events trigger enqueue_admin_notification() (server events) or enqueue_user_notification() (user payment events)
  2. A background task continuously processes the notification queue
  3. Each notification is routed through all enabled channels
  4. Failed deliveries are logged but don't block the system

News · Shop · SaaS · Telegram · Released under the MIT License.