librechat-balances/.env.example
DJP 81e18f8a73 Add email notifications with one-click approve/reject from email
When a user submits a credit request, an email is sent to all
configured NOTIFY_TO recipients with approve buttons (5M, 10M, 20M),
a custom amount option, and a reject button. Each button is a
signed HMAC-SHA256 webhook URL that expires after WEBHOOK_TTL_HOURS.

Clicking approve from email processes the top-up identical to the
admin dashboard — balance update, history log, request status change.
Double-approval protection prevents the same link from being used
twice. Portal approval still works alongside email approval.

New dependencies: nodemailer
New files: services/email.js, routes/webhooks.js
Modified: server.js, routes/requests.js, .env.example

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 09:50:44 -04:00

18 lines
498 B
Text

MONGO_URI=mongodb://mongodb:27017/LibreChat
PORT=3002
API_KEY=change-me-to-a-secure-key
# Webhook security
WEBHOOK_SECRET=change-me-to-a-random-secret
WEBHOOK_BASE_URL=https://your-domain.com/balance-manager
WEBHOOK_TTL_HOURS=72
# SMTP (Mailgun or any SMTP server)
SMTP_HOST=smtp.mailgun.org
SMTP_PORT=587
SMTP_USER=postmaster@mg.yourdomain.com
SMTP_PASS=your-smtp-password
SMTP_FROM=noreply@yourdomain.com
# Notification recipients (comma-separated for multiple)
NOTIFY_TO=admin@yourdomain.com