This page contains reference information for building conditional expressions using Remote Config backend APIs or the Firebase console. For more information about setting up and using the backend APIs, see Modify Remote Config programmatically.
Elements used to create conditions
The Remote Config REST API supports the same elements that you can use to create conditions when configuring Remote Config using the Firebase Console:
| Element | Description | 
|---|---|
|  &&  | Used to create a logical "and" of elements if using more than one element
  for a condition. If an element is used in REST syntax without the
   Note: a space is required before and after the ampersands. For example:
   | 
| app.build | 
  Evaluates to  Note: Only available on Apple and Android devices. For Apple, use the value of CFBundleVersion and for Android, use the value of versionCode. | 
| app.version | 
  Evaluates to  Note: For Android devices use the value of versionName, and for Apple devices use the value of CFBundleShortVersionString. | 
| app.id | An element based on the app's Firebase App ID | 
| app.audiences | An element that evaluates to TRUEorFALSEbased
  on the user's presence or absence in one or more
  Firebase Analytics audience(s). | 
| app.firstOpenTimestamp | An element based on the first time the user launches an app, obtained from
the Google Analytics first_openevent. Uses ISO date
format with the option to specify a fixed time zone; for example,app.firstOpenTimestamp >= ('2022-10-31T14:37:47', 'America/Los_Angeles').
  If no time zone is specified, GMT is used. | 
| app.userProperty | An element that evaluates to TRUEorFALSEbased
  on the numeric or string value of a
  Google Analytics
     User Property. | 
| app.operatingSystemAndVersion | An element based on the operating system on which an app is running.
  Evaluates to  Note: Only available for Web apps. | 
| app.browserAndVersion | An element based on the browser on which an app is running.
  Evaluates to  Note: Only available for Web apps. | 
| app.firebaseInstallationId | An element based on the IDs of specific device installations.
  Evaluates to TRUEwhen the
  installation
  ID matches one of specified installation IDs. | 
| app.customSignal | An element that evaluates to TRUEorFALSEbased
  on the numeric, semantic, or string value of the custom signal conditions. | 
| device.country | An element based on the region/country that a device is located in, using
  the ISO 3166-1 alpha-2 standard  (for example, US or UK). Evaluates to TRUEwhen a country matches an expected country code. | 
| device.dateTime | An element based on the time of the last fetch the device performs.
  Uses ISO date format with the
  option to specify a fixed time zone; for example, dateTime('2017-03-22T13:39:44', 'America/Los_Angeles'). | 
| device.language | An element based on the language selected on a device. The language is
  represented using an IETF Language tag such as es-ES, pt-BR, or en-US.
  Evaluates to TRUEwhen a language matches an expected language
  code. | 
| device.os | An element based on the operating system used on a device (Apple or Android).
  Evaluates to TRUEwhen the device OS is the expected type. | 
| percent | Evaluates to TRUEbased on a user's inclusion in a randomly
    assigned fractional percentage (with sample sizes as small as 0.000001%). | 
A single-element condition contains three fields:
- An arbitrarily-defined name(up to 100 characters)
- A conditional expression that evaluates to TRUEorFALSE, made up of the elements shown above.
- (Optional) The tagColor, which can be "BLUE", "BROWN", "CYAN", "DEEP_ORANGE", "GREEN", "INDIGO", "LIME", "ORANGE", "PINK", "PURPLE", or "TEAL". The color is case-insensitive, and only affects how conditions are displayed in the Firebase console.
Supported operators
| Element | Supported operators | Description | 
|---|---|---|
| app.audiences | .inAtLeastOne([...]) | Returns  app.audiences.inAtLeastOne(['Audience 1', 'Audience 2']) | 
| app.audiences | .notInAtLeastOne([...]) | Returns  | 
| app.audiences | .inAll([...]) | Returns  | 
| app.audiences | .notInAll([...]) | Returns  | 
| app.firstOpenTimestamp | <=, > | Compares the time of the  | 
| app.userProperty | <,<=,==,!=,>=,> | Returns  | 
| app.userProperty | .contains([...]) | Returns  | 
| app.userProperty | .notContains([...]) | Returns  | 
| app.userProperty | .exactlyMatches([...]) | Returns  | 
| app.userProperty | .matches([...]) | Returns  | 
| app.id | == | Returns  | 
| app.build | <,<=,==,!=,>=,> | Returns  | 
| app.build | .contains([...]) | Returns  | 
| app.build | .notContains([...]) | For example,Returns  | app.build | .exactlyMatches([...]) | Returns  | 
| app.build | .matches([...]) | Returns  | 
| app.version | <,<=,==,!=,>=,> | Returns  | 
| app.version | .contains([...]) | Returns  | 
| app.version | .notContains([...]) | For example,Returns  | 
| app.version | .exactlyMatches([...]) | Returns  | 
| app.version | .matches([...]) | Returns  | 
| app.operatingSystemAndVersion | .inOne([...]) | Returns  
    app.operatingSystemAndVersion.inOne([operatingSystemName('Macintosh')
    .version.==('10.15')])
     | 
| app.browserAndVersion | .inOne([...]) | Returns  
    app.browserAndVersion.inOne([browserName('Chrome').anyVersion])
     | 
| app.firebaseInstallationId | in [...] | Returns  | 
| app.customSignal | <,<=,==,!=,>=,> | Returns  | 
| app.customSignal | .contains([...]) | Returns  | 
| app.customSignal | .notContains([...]) | Returns  | 
| app.customSignal | .exactlyMatches([...]) | Returns  | 
| app.customSignal | .matches([...]) | Returns  | 
| version(app.customSignal) | <,<=,==,!=,>=,> | Returns  | device.country | in [...] | Returns  | 
| device.dateTime | <=,> | Compares the current time
  to the target time of the condition and evaluates to  | 
| device.language | in [...] | Returns  | 
| device.os | ==,!= | Returns TRUEif the device's operating system compares
  to the value in that field matching the operator. | 
| percent | <=,>,between | Returns  You can specify a seed to select a new randomly-assigned group of app instances for a given percentage range as described in Condition rule types. To do this, provide the name of the seed before the operator, as in the following example: percent('keyName') <= 10To configure a specific range, you can use the  percent between 20 and 60 To configure a range of users between 60 and 80 using a custom seed: percent('seedName') between 60 and 80 |