Directly Checking a Flag

Check if a flag is on

if (Toggly.isFeatureOn('SignUpButton')) {
    // SignUpButton is ON

Check if at least one of the listed flags is on

if (Toggly.evaluateFeatureGate(['ExampleFeatureKey1', 'ExampleFeatureKey2'], FeatureRequirement.any)) {
  // AT LEAST ONE the provided feature keys is TRUE

Evaluate a feature gate (with requirement & negate support)

if (Toggly.evaluateFeatureGate(['ExampleFeatureKey1', 'ExampleFeatureKey2'], FeatureRequirement.all, true)) {
  // ALL the provided feature keys are FALSE

Last updated