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=disablePostgreSQL connection string
JWT_SECRETdev-secret-change-in-productionSecret for JWT token signing
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:3000Allowed CORS origin

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://flags.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