This file documents the environment variables required by the ACBU backend and the defaults used by the runtime.
CRITICAL: The .env file contains sensitive credentials. Follow these practices:
- Never commit
.envto git — add it to.gitignore(already configured). - Use
.env.exampleas a template — it contains placeholder values only. - Rotate credentials immediately if
.envis ever accidentally exposed or committed. - Validate URL syntax before deployment:
RABBITMQ_URL— must followamqp://user:password@host:port/vhostDATABASE_URL— must be a valid PostgreSQL connection stringMONGODB_URI— must be a valid MongoDB connection string
- Use strong secrets —
JWT_SECRETmust be at least 32 characters in production. - Production secrets — use your cloud provider's secrets manager (AWS Secrets Manager, GCP Secret Manager, etc.).
- Environment-specific files — keep separate
.env.production,.env.staging(not in git) with real credentials.
If credentials are exposed:
- Rotate all API keys, database passwords, and secrets immediately.
- Audit git history:
git log --all --source --full-history -- .env - Force-push to remove sensitive commits (requires admin approval).
DATABASE_URL- Direct PostgreSQL connection string for Prisma migrations and local runtime fallback.
- Must not use
prisma://orprisma+postgres://.
MONGODB_URI- MongoDB connection string for the cache layer.
RABBITMQ_URL- RabbitMQ connection string for queue-based features.
JWT_SECRET- Secret used for JWT signing and verification.
- Must be at least 32 characters and must not equal the documented
.env.exampleplaceholder value.
BILLS_WEBHOOK_SECRET- HMAC secret for verifying
/v1/webhooks/bills/:providersignatures. Required in production.
- HMAC secret for verifying
PRISMA_ACCELERATE_URL- Optional for local development.
- When set, the app uses Prisma Accelerate for runtime queries.
- Must start with
prisma://orprisma+postgres://. - In production, this variable is required.
PRISMA_MIGRATION_HISTORY_REPLICATED- Defaults to
false. - In production, set to
trueonly after verifying_prisma_migrationsis replicated to failover targets. - The app refuses to run startup migrations in production until this is explicitly acknowledged.
- Defaults to
NODE_ENV- defaults todevelopmentPORT- defaults to5000API_VERSION- defaults tov1CHALLENGE_TOKEN_SECRET- required explicitly in production (distinct fromJWT_SECRET); falls back toJWT_SECREToutside productionJWT_EXPIRES_IN- defaults to7dJWT_CLOCK_TOLERANCE_SECONDS- defaults to30API_KEY_SALT- defaults to empty stringADMIN_API_KEY- Single admin key (legacy support)ADMIN_API_KEYS- Comma-separated list of admin keys oradminId:keypairs for multi-admin authentication and attributionLOG_LEVEL- defaults toinfoLOG_FILE- defaults tologs/app.log
RATE_LIMIT_WINDOW_MS- defaults to60000RATE_LIMIT_MAX_REQUESTS- defaults to100AUTH_RATE_LIMIT_WINDOW_MS- defaults to900000AUTH_RATE_LIMIT_MAX_REQUESTS- defaults to10ADMIN_RATE_LIMIT_WINDOW_MS- defaults to60000ADMIN_RATE_LIMIT_MAX_REQUESTS- defaults to30RATE_LIMIT_FALLBACK_MAX_REQUESTS- defaults to20RATE_LIMIT_CIRCUIT_BREAKER_THRESHOLD- defaults to5RATE_LIMIT_CIRCUIT_BREAKER_COOLDOWN_MS- defaults to60000
PII_ENCRYPTION_KEY- Optional.
- Must be exactly 64 hex characters (32 bytes).
CAPTCHA_SECRETAUTH_BRUTE_MAX_ATTEMPTS- defaults to5AUTH_BRUTE_LOCKOUT_MS- defaults to900000
FLUTTERWAVE_PUBLIC_KEYFLUTTERWAVE_SECRET_KEYFLUTTERWAVE_ENCRYPTION_KEYFLUTTERWAVE_WEBHOOK_SECRETFLUTTERWAVE_BASE_URLPAYSTACK_SECRET_KEYPAYSTACK_BASE_URLMTN_MOMO_SUBSCRIPTION_KEYMTN_MOMO_API_USER_IDMTN_MOMO_API_KEYMTN_MOMO_BASE_URLMTN_MOMO_TARGET_ENVIRONMENTFINTECH_CURRENCY_PROVIDERS
AWS_REGIONorS3_REGIONS3_BUCKETS3_ENDPOINTAWS_ACCESS_KEY_IDorS3_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYorS3_SECRET_ACCESS_KEYS3_UPLOAD_URL_TTL_SECONDS- defaults to900S3_DOWNLOAD_URL_TTL_SECONDS- defaults to300S3_SCAN_WEBHOOK_SECRET
STELLAR_NETWORK- defaults totestnetSTELLAR_HORIZON_URLSTELLAR_SOROBAN_RPC_URLSTELLAR_SECRET_KEYSTELLAR_NATIVE_ASSET_CODEWALLET_ACTIVATION_STRATEGY- defaults tocreate_account_nativeTESTNET_CUSTODIAL_BOOTSTRAP- Deployment / runbook label identifying the Stellar testnet bootstrap profile.
- Used for diagnostics and log context only; it does not affect
nativeAssetCode(that is alwaysXLMunlessSTELLAR_NATIVE_ASSET_CODEis set). - Pi Network bridge variables were removed; activation is Stellar-only. See docs/ACTIVATION_SCOPE.md for the scope decision record (W10-P-007).
WALLET_ACTIVATION_AMOUNT/WALLET_ACTIVATION_NATIVE/WALLET_ACTIVATION_XLM/STELLAR_MIN_BALANCESTELLAR_BASE_FEE_STROOPS- defaults to100STELLAR_USE_DYNAMIC_FEES- defaults tofalse; whentrue, reads the live base fee from Horizon for each payment instead of trustingSTELLAR_BASE_FEE_STROOPSSTELLAR_SOROBAN_MIN_FEE_STROOPS- defaults to5000STELLAR_SOROBAN_MAX_FEE_STROOPS- defaults to10000000STELLAR_FEE_SURGE_BUFFER_BPS- defaults to2000(20%); buffer added on top of the live base fee for classic payments,0–10000bps. See AB-052.STELLAR_MAX_PAYMENT_FEE_STROOPS- defaults to1000000; hard ceiling on the fee of a single classic payment. If the live base fee plus buffer exceeds this, the payment fails with aSTELLAR_FEE_SURGE(HTTP 503) instead of paying an unbounded fee. See AB-052.USDC_ISSUER_TESTNETUSDC_ISSUER_MAINNETUSDC_ASSET_CODE_TESTNET- defaults toUSDCUSDC_ASSET_CODE_MAINNET- defaults toUSDCUSDC_XLM_SLIPPAGE_BPS- defaults to50
ORACLE_UPDATE_INTERVAL_HOURS- defaults to6ORACLE_EMERGENCY_THRESHOLD- defaults to0.05ORACLE_MAX_DEVIATION_PER_UPDATE- defaults to0.05ORACLE_CIRCUIT_BREAKER_THRESHOLD- defaults to0.10EXCHANGERATE_API_BASE_URL- defaults tohttps://v6.exchangerate-api.com/v6EXCHANGERATE_API_KEYCURRENCY_CENTRAL_BANK_URLS
RESERVE_MIN_RATIO- defaults to1.02RESERVE_TARGET_RATIO- defaults to1.05RESERVE_ALERT_THRESHOLD- defaults to1.02
RESERVE_METRICS_INTERVAL_MS- Interval for reserve metrics update job (default: 300000, i.e., 5 minutes)ENABLE_OBSERVABILITY- Enable observability features (metrics, tracing). Defaults totrue
NOTIFICATION_EMAIL_PROVIDER- defaults tologNOTIFICATION_FROM_EMAIL- defaults tonoreply@acbu.ioSENDGRID_API_KEYAWS_SES_REGIONNOTIFICATION_SMS_PROVIDER- defaults tologNOTIFICATION_ALERT_EMAIL- Optional. Comma-separated list of email addresses that receive reserve-alert
emails and the weekly weight-drift audit report
(
src/jobs/weightDriftAuditJob.ts, read asconfig.notification.alertEmail). - Example:
ops@example.comorops@example.com,admin@example.com - When absent or empty, the audit job still runs and persists the audit record — it simply skips sending the email notification.
- Optional. Comma-separated list of email addresses that receive reserve-alert
emails and the weekly weight-drift audit report
(
TWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKENTWILIO_FROM_NUMBERAFRICAS_TALKING_API_KEYAFRICAS_TALKING_USERNAME
WEBHOOK_URLWEBHOOK_SECRET
OPENAI_API_KEYOPENAI_ORG_MONTHLY_BUDGET_USD- defaults to50OPENAI_MAX_TOKENS_PER_REQUEST- defaults to2000OPENAI_FAIL_OPEN_ENABLED- defaults tofalse(fail-closed for security/KYC compliance; set totrueto fail open during service degradation)OPENAI_FAIL_OPEN_TIMEOUT_MS- defaults to2000(timeout per request attempt in ms)OPENAI_FAIL_OPEN_MAX_RETRIES- defaults to2(retry attempts on transient errors)OPENAI_FAIL_OPEN_RETRY_BASE_MS- defaults to500(exponential backoff base in ms)
CORS_ORIGIN- Comma-separated list of allowed origins.
- In production,
PRISMA_ACCELERATE_URLis required. DATABASE_URLshould always be a direct PostgreSQL URL for migrations.PRISMA_ACCELERATE_URLshould be used for runtime database queries when set.PRISMA_MIGRATION_HISTORY_REPLICATED=trueconfirms promoted replicas retain Prisma migration history.- If you need the exact runtime schema, refer to
src/config/env.ts.