Creating new flags

Create a flag, define its key and variations, and configure default serving behavior.

Overview

This topic explains how to create a new feature flag and configure its first serving behavior.

When you create a flag, the name should be clear and descriptive. Truflag derives a stable key from that name for SDK reads in code.

A flag can be used for UI releases, backend behavior changes, operational kill-switches, staged rollouts, experimentation, and much more.

Create a feature flag

You create and modify flags from the Flags list. The create dialog captures the metadata, variation type, and initial ON/OFF serving defaults.

After a key is in production code, changing it requires coordinated code updates and deployment.

  1. Open Configuration -> Flags and click Create flag.
  2. Enter a human-readable Name.
  3. Select a variation type: Boolean, String, Number, or JSON.
  4. For multivariate types, add additional variations as needed.
  5. Set the ON default-rule variation (Default audience) and OFF variation.
  6. Click Create flag.
  7. Review the new flag on its detail page.
  8. Click Save changes after any additional edits.

Create flag entry point

1 / 2

Create flag entry point
Click image to fullscreen

Configure the same flag in different environments

Flags are project-level resources and appear in every environment in that project.

**Serving configuration is environment-specific.** A targeting or rollout change in one environment does not silently mutate another environment.

Use environment switching to compare behavior between staging and production before rollout.

Set ON/OFF serving behavior

A new flag has initial ON and OFF serving behavior.

When the flag is ON, the catch-all Default audience (default rule/fallthrough) is the final path for users who do not match prior targeting rules.

When the flag is OFF, Truflag serves the configured offVariationID.

If refresh fails after values are loaded, SDK keeps last-known-good values.

Always provide an explicit fallback argument in code (useFlag(flagKey, fallback) or Flags.getFlag(flagKey, fallback)).

That fallback argument is used when SDK state is not ready or the key is missing.

Create flag modal fields

Create flag modal fields
Click image to fullscreen