Every setting is an environment variable. Pass them in the environment, or to
FeaturekitServer by name in env. The defaults are for a laptop; production refuses
to start on the ones that matter.
With NODE_ENV=production, a missing DATABASE_URL stops the start. So does a missing
SECURE_MODE_SECRET when you declare client keys exist (clientKeysExist, or
FEATUREKIT_CLIENT_KEYS_EXIST=1); without that, production client requests are refused until it's set.
Every missing variable is listed in one error: three restarts to discover three missing variables would be
three outages.
Server and database
Variable
Default
What it does
NODE_ENV
development
development, test or production.
PORT, HOST
3000, 127.0.0.1
Where to listen. Use 0.0.0.0 in a container.
DATABASE_URL
a local Postgres
Postgres connection string.
DATABASE_SCHEMA
public
The one schema featurekit owns. Lowercase letters, digits and underscores, not starting with pg_. Created by migrations.
DATABASE_LISTEN_URL
DATABASE_URL
A direct Postgres address for LISTEN, when queries go through pgbouncer.
DB_MAX_CONNECTIONS
10
Pool size per node.
LOG_LEVEL
info
fatal, error, warn, info, debug, trace or silent.
SHUTDOWN_GRACE_MS
10000
How long in-flight requests get on shutdown.
Security
Variable
Default
What it does
SECURE_MODE_SECRET
Verifies signed client contexts. At least 32 characters. Comma-separated to rotate: signs with the first, verifies with all.
SECURE_MODE_MAX_TTL_SECONDS
86400
Longest signature lifetime accepted, whatever was signed.
UNSIGNED_CONTEXT_ENVIRONMENT_IDS
Production environment ids allowed to skip signing. Comma-separated.
CORS_ALLOWED_ORIGINS
same origin only
Exact origins allowed to call the client tier. Comma-separated. Never *.
SDK_KEY_CACHE_TTL_MS
30000
How long a key lookup is cached, which bounds how long a revoked key keeps working on other nodes.
Dashboard and first account
Variable
Default
What it does
DASHBOARD
the bundled one
A directory to serve instead, or off to serve no UI at all.
DASHBOARD_PATH
/admin
Where it's served.
FEATUREKIT_ADMIN_EMAIL, FEATUREKIT_ADMIN_PASSWORD
Create this owner account on start if it doesn't exist. The password needs 12+ characters.
Rate limits
Per caller, per minute, per node: behind a load balancer over N nodes, a caller can reach N times these.
Variable
Default
Applies to
RATE_LIMIT_CLIENT_STATE_PER_MIN
600
POST /v1/client/state
RATE_LIMIT_SNAPSHOT_PER_MIN
240
GET /v1/snapshot
RATE_LIMIT_STREAM_PER_MIN
60
Opening either stream
RATE_LIMIT_EVENTS_PER_MIN
120
POST /v1/events
RATE_LIMIT_ADMIN_PER_MIN
300
The busier admin routes
RATE_LIMIT_LOGIN_PER_MIN
10
Dashboard sign-in
RATE_LIMIT_OVERRIDES
Per-environment overrides as env:route:limit, comma-separated, like production:/v1/snapshot/:envKey:2000.
Propagation and streaming
Variable
Default
What it does
SNAPSHOT_DEBOUNCE_MS
200
How long to batch changes before compiling. Raise it for environments with tens of thousands of flags.
PATCH_HISTORY_DEPTH
200
Patches kept for SDKs that reconnect.
MAX_STREAM_CONNECTIONS
10000
Server streams per node, after which SDKs poll.
MAX_CLIENT_CONNECTIONS
50000
Client streams per node.
STREAM_HEARTBEAT_MS
30000
Keep-alive interval on every stream.
CLIENT_CONNECTION_TTL_SECONDS
900
How long a client connection can be resumed on another node.
Segments
Variable
Default
What it does
SEGMENT_INLINE_MAX
50000
Up to this many members, a segment is an exact list in the snapshot. Beyond it, a compact filter.
SEGMENT_MEMBER_CEILING
2000000
Most members one compile reads per segment. Past it the compile fails and the last snapshot keeps serving.
SEGMENT_MEMBER_PAGE_SIZE
25000
Rows per read while compiling.
Analytics and the scheduler
Variable
Default
What it does
EVENT_BUFFER_MAX
100000
Evaluation summaries buffered before the oldest are dropped.
EVENT_FLUSH_INTERVAL_MS
5000
How often the buffer is written.
ROLLUP_BUCKET_SECONDS
60
Time bucket for metrics.
ROLLUP_RETENTION_DAYS
90
Kept this long, when pg_partman is installed. Applied at migration.
ROLLUP_PARTITION_PREMAKE_DAYS
7
Partitions created ahead. At least 2.
PARTITION_RUNWAY_MIN_DAYS
2
Below this many days of partitions, /ready fails.
SCHEDULER_INTERVAL_MS
15000
How often each node looks for due scheduled changes.
SCHEDULER_GRACE_MS
3600000
How late a scheduled change may still run. Later than this, it's marked failed instead.
Sharing a database
Each install owns one schema: its tables, types, functions, partitions and migration history. Several installs
can share a database in different schemas. Connections use only that schema on their
search_path, so a missing table is an error, never a silent read from public.