Skip to main content

Flag Reference


Functions

parseFeatureFlags(env?)

Parses flags from process.env or a custom key-value map. Never throws — all flags have safe defaults.

getFeatureFlags()

Shorthand for parseFeatureFlags(process.env).

isLocalExecutionEnabled(userId, flags?)

Determines whether local execution is active for a specific user. Checks in order:
  1. Kill switch → always false
  2. Force flag → always true
  3. Canary percentage → hash-based user bucketing

isServerExecutionEnabled(flags?)

Returns flags.SERVER_EXECUTION_ENABLED.

validateFlagConfiguration(flags)

Checks for invalid flag combinations.
Catches:
  • FORCE_LOCAL_EXECUTION and KILL_SWITCH_LOCAL_EXECUTION both enabled
  • Both LOCAL_EXECUTION_ENABLED and SERVER_EXECUTION_ENABLED disabled

getMigrationPhase(flags?)

Returns the current rollout phase as a string.

Migration Phases