| Variable | Description | Default | Required |
|---|---|---|---|
| PORT | Server port | 3001 | No |
| CORS_ALLOWED_ORIGINS | Allowed origins for CORS | * | No |
| JOBS_ENABLED | Enable/disable background jobs | true | No |
| STELLAR_NETWORK | Stellar network (testnet or public) | testnet | No |
| OPENAI_API_KEY | OpenAI API key for AI services | - | Yes |
| AGENTICPAY_ALLOWED_SIGNATURE_ORIGINS | Allowed origins for EIP-712 signature verification | https://agenticpay.com,http://localhost:3000 | No |
| VAPID_PUBLIC_KEY | VAPID public key for Web Push API | auto-generated | No |
| VAPID_PRIVATE_KEY | VAPID private key for Web Push API | auto-generated | No |
| WS_ENABLED | Enable/disable WebSocket support | true | No |
| WS_PORT | WebSocket port | 3001 | No |
| DB_READ_REPLICA_URLS | Comma-separated PostgreSQL read replica URLs | - | No |
| DB_REPLICA_MAX_LAG_MS | Maximum replica lag before primary failover | 5000 | No |
| DB_REPLICA_HEALTH_CHECK_INTERVAL_MS | Interval for replica health checks | 30000 | No |
| DB_REPLICA_FAILOVER_COOLDOWN_MS | Cooldown after replica failover | 15000 | No |
| Variable | Description | Default |
|---|---|---|
| NEXT_PUBLIC_API_URL | Backend API base URL | http://localhost:3001/api/v1 |
| NEXT_PUBLIC_BACKEND_URL | Backend URL fallback | http://localhost:3001/api/v1 |
| NEXT_PUBLIC_WS_URL | WebSocket URL | http://localhost:3001 |
| NEXT_PUBLIC_WS_ENABLED | Enable WebSocket | true |
.env.example
PORT=3001
CORS_ALLOWED_ORIGINS=http://localhost:3000
JOBS_ENABLED=true
STELLAR_NETWORK=testnet
OPENAI_API_KEY=sk-your-openai-api-key
AGENTICPAY_ALLOWED_SIGNATURE_ORIGINS=https://agenticpay.com,http://localhost:3000
VAPID_PUBLIC_KEY=your-vapid-public-key
VAPID_PRIVATE_KEY=your-vapid-private-key
WS_ENABLED=true
DB_READ_REPLICA_URLS=
DB_REPLICA_MAX_LAG_MS=5000
.env.development— local development.env.staging— staging environment.env.production— production environment
To generate VAPID keys for push notifications:
cd backend
npm run generate:vapid-keysThis will output both public and private keys. Add them to your .env file:
VAPID_PUBLIC_KEY=<key_from_output>
VAPID_PRIVATE_KEY=<key_from_output>
Important: Keep your VAPID private key secret and never commit it to version control.
See PUSH_NOTIFICATIONS.md for complete push notification setup guide.
- Never commit
.envfiles containing real secrets to version control - Copy the appropriate file and rename to
.envwhen running locally - VAPID keys are required for push notification functionality
- WebSocket support is required for real-time notifications