Skip to main content
A feature flag is a named switch in your code. Instead of hardcoding behavior, you ask Softlaunch what a flag should return for a given user, and change that answer from the dashboard — no redeploy.

Flag types

Every flag has a type, set when you create it. The type determines the shape of the value the SDK returns.
TypeReturnsExample use
booleantrue or falseGate a feature on or off
stringA text valueChoose a variant name, theme, or copy
integerA whole numberA limit, count, or threshold
numericA decimal numberA rate, multiplier, or price
jsonA structured objectA bundle of related settings
Each SDK exposes a typed method per flag type, so you read a flag with the same type you defined. If a flag’s type doesn’t match the method you call, the SDK returns your default value.

Variations

A variation is a value a flag can return. A boolean flag has two variations (true and false); other types can have as many as you need — for example a string flag with control, treatment-a, and treatment-b. When you evaluate a flag, Softlaunch resolves it to exactly one variation based on the flag’s configuration in that environment.

Default values

Every SDK call requires a default value. The SDK returns it when:
  • The configuration hasn’t loaded yet.
  • The flag doesn’t exist in that environment.
  • The flag’s type doesn’t match the method you called.
Choose a default that is safe to serve to every user. It’s the value your app falls back to whenever Softlaunch can’t return a definitive answer.

Enabling and disabling

A flag is enabled or disabled per environment. A disabled flag serves its configured off value to everyone, regardless of targeting. This lets you keep the same flag configured differently in Staging and Production.

Environments and SDK keys

Learn how a flag can behave differently across environments.