Skip to main content

Rules

Rule

  • name | The name of this rule.
  • passPercentage | Of the users that meet the conditions of this rule, what percent should return true.
  • conditions | An array of Condition objects.
{
"name": "Public",
"passPercentage": 10,
"conditions": [
{
"type": "public"
}
]
}

Condition

  • type | The type of condition it is.
  • operator | What form of evaluation should be run against the targetValue.
  • targetValue | The value or values you wish to evaluate.
{
"type": "user_id",
"operator": "any",
"targetValue": ["111", "222"]
}

----

All Conditions

Everyone

Can not be used in conditional segments

  • type: public
  • operator: null
  • targetValue: null
  • Learn more at Feature Flags > Conditions > Everyone
{
"type": "public"
}

User ID

  • type: user_id
  • operator: any | none
  • targetValue: string | number | string[] | number[]
  • Learn more at Feature Flags > Conditions > User ID
{
"type": "user_id",
"operator": "any",
"targetValue": ["111", "222"]
}

Email

  • type: email
  • operator: any | none | str_contains_any | str_contains_none
  • targetValue: string | string[]
  • Learn more at Feature Flags > Conditions > Email
{
"type": "email",
"operator": "str_contains_any",
"targetValue": ["@outlook.com", "@gmail.com"]
}

Custom Field

  • type: custom_field
  • operator:
    • string: any | none | str_contains_any | str_contains_none
    • number: any | none | lt | gt
    • version: any | none| version_lt | version_gt | version_lte | version_gte
    • date: before | after | on
  • targetValue: string | number | string[] | number[]
  • field: field_name
  • Learn more at Feature Flags > Conditions > Custom
{
"type": "custom_field",
"operator": "gt",
"targetValue": 31,
"field": "age"
}

Unit ID

  • type: unit_id
  • operator:
    • string: any | none | str_contains_any | str_contains_none
    • Any: any | none | is_null | is_not_null
  • targetValue: string | number | string[] | number[]
  • field: field_name
  • Learn more at Feature Flags > Conditions > Unit ID
{
"type": "unit_id",
"targetValue": ["passingValue1", "passingValue2"],
"operator": "any",
"customID": "a_custom_id"
}

App Version

  • type: app_version
  • operator: any | none | version_lt | version_gt | version_lte | version_gte
  • targetValue: string | number | string[] | number[]
  • Learn more at Feature Flags > Conditions > App Version
{
"type": "app_version",
"operator": "version_gt",
"targetValue": "1.1.1"
}

Browser Name

  • type: browser_name
  • operator: any | none
  • targetValue: Android | Chrome | Chrome Mobile | Edge | Edge Mobile | IE | IE Mobile | Opera | Opera Mobile | Firefox | Firefox Mobile | Mobile Safari | Safari
  • Learn more at Feature Flags > Conditions > Browser
{
"type": "browser_name",
"operator": "any",
"targetValue": ["Android", "Chrome"]
}

Browser Version

  • type: browser_version
  • operator: any | none | version_lt | version_gt | version_lte | version_gte
  • targetValue: string | number | string[] | number[]
  • Learn more at Feature Flags > Conditions > Browser Version
{
"type": "browser_version",
"operator": "any",
"targetValue": ["94.0.4606.81", "94.0.4606.92"]
}

Operating System

  • type: os_name
  • operator: any | none
  • targetValue: Android | iOS | Linux | Mac OS X | Windows
  • Learn more at Feature Flags > Conditions > Operating System
{
"type": "os_name",
"operator": "none",
"targetValue": ["Android", "Windows"]
}

OS Version

  • type: os_version
  • operator: any | none | version_lt | version_gt | version_lte | version_gte
  • targetValue: string | number | string[] | number[]
  • Learn more at Feature Flags > Conditions > OS Version
{
"type": "os_version",
"operator": "version_lte",
"targetValue": ["11.0.0"]
}

Country

  • type: country
  • operator: any | none
  • targetValue: 2 Letter Country Code
  • Learn more at Feature Flags > Conditions > Country
{
"type": "country",
"operator": "any",
"targetValue": ["NZ", "US"]
}

Passes Gate

Can not be used in conditional segments

  • type: passes_gate
  • operator: null
  • targetValue: gate_id
  • Learn more at Feature Flags > Conditions > Passes Target gate
{
"type": "passes_gate",
"targetValue": "a_gate"
}

Fails Gate

Can not be used in conditional segments

  • type: fails_gate
  • operator: null
  • targetValue: gate_id
  • Learn more at Feature Flags > Conditions > Fails Target gate
{
"type": "fails_gate",
"targetValue": "a_gate"
}

Time

Can not be used in conditional segments

  • type: time
  • operator: any | none | lt | gt
  • targetValue: string | number | string[] | number[]
  • Learn more at Feature Flags > Conditions > Time
{
"type": "time",
"operator": "after",
"targetValue": 1643070357193
}

Environment Tier

  • type: environment_tier
  • operator: any | none
  • targetValue: development | staging | production
  • Learn more at Feature Flags > Conditions > Environment Tier
{
"type": "environment_tier",
"targetValue": "production"
}

User in Segment

  • type: passes_segment
  • operator: null
  • targetValue: segment_id
  • Learn more at Feature Flags > Conditions > User in Segment
{
"type": "passes_segment",
"targetValue": "growth_org"
}

User not in Segment

  • type: fails_segment
  • operator: null
  • targetValue: segment_id
  • Learn more at Feature Flags > Conditions > User not in Segment
{
"type": "fails_segment",
"targetValue": "growth_org"
}

IP Address

  • type: ip_address
  • operator: any | none
  • targetValue: string | string[]
  • Learn more at Feature Flags > Conditions > IP address
{
"type": "ip_address",
"operator": "any",
"targetValue": ["1.1.1.1", "8.8.8.8"]
}