Skip to main content

Configuration Reference

All configuration is done via environment variables.

API Server

VariableDefaultDescription
PORT8080HTTP server port
DATABASE_URLpostgres://fs:fsdev@localhost:5432/featuresignals?sslmode=requirePostgreSQL connection string
JWT_SECRETdev-secret-change-in-productionSecret for JWT token signing. Must not be left at the default in non-debug environments — the server will refuse to start.
TOKEN_TTL_MINUTES60Access token lifetime (minutes)
REFRESH_TTL_HOURS168Refresh token lifetime (hours, default 7 days)
LOG_LEVELinfoLog level: debug, info, warn, error
CORS_ORIGINhttp://localhost:3000Comma-separated list of allowed CORS origins. Include your dashboard and docs site (for the API Playground).
APP_BASE_URLhttp://localhost:8080Public URL of the API server
DASHBOARD_URLhttp://localhost:3000Public URL of the dashboard

Email (ZeptoMail)

VariableDefaultDescription
EMAIL_PROVIDERzeptomailEmail provider: zeptomail, smtp, or none
ZEPTOMAIL_TOKEN(empty)ZeptoMail Send Mail Token — required for email delivery
ZEPTOMAIL_FROM_EMAILnoreply@featuresignals.comDefault sender email address
ZEPTOMAIL_FROM_NAMEFeatureSignalsDefault sender display name
ZEPTOMAIL_BASE_URLhttps://api.zeptomail.inZeptoMail API endpoint (India region)

PayU Billing

VariableDefaultDescription
PAYU_MERCHANT_KEY(empty)PayU merchant key
PAYU_SALT(empty)PayU salt for hash verification
PAYU_MODEtesttest or live

Example

export DATABASE_URL="postgres://fs:strongpass@db.example.com:5432/featuresignals?sslmode=require"
export JWT_SECRET="$(openssl rand -hex 32)"
export CORS_ORIGIN="https://app.example.com,https://docs.example.com"
export PORT=8080
export LOG_LEVEL=info
export TOKEN_TTL_MINUTES=30
export REFRESH_TTL_HOURS=168

Dashboard

VariableDefaultDescription
NEXT_PUBLIC_API_URLhttp://localhost:8080API server URL (used by browser)
caution

NEXT_PUBLIC_API_URL must be accessible from the user's browser, not just the server. In production, use the public API URL (e.g., https://api.example.com).

Relay Proxy

FlagEnvironment VariableDefaultDescription
-api-keyFS_API_KEY(required)Server API key
-env-keyFS_ENV_KEY(required)Environment slug
-upstreamFS_UPSTREAMhttps://api.featuresignals.comUpstream API URL
-portFS_PORT8090Local listening port
-pollFS_POLL30sPolling interval
-sseFS_SSEtrueUse SSE for real-time sync

PostgreSQL Requirements

  • Version: 14 or later (16 recommended)
  • Extensions: None required (standard PostgreSQL)
  • Connection pool: The server uses pgxpool with default settings

For production workloads:

# postgresql.conf
max_connections = 100
shared_buffers = 256MB
work_mem = 4MB
maintenance_work_mem = 64MB

Docker Environment

When using Docker Compose, environment variables are set in docker-compose.yml or via a .env file:

# .env
DATABASE_URL=postgres://fs:strongpass@postgres:5432/featuresignals?sslmode=disable
JWT_SECRET=my-production-secret
CORS_ORIGIN=https://flags.example.com
NEXT_PUBLIC_API_URL=https://api.example.com