Remote Config REST API Reference

This page contains reference information for Remote Config REST API. For more information about setting up and using this API, see Use the Remote Config REST API.

Elements used to create conditions

The Remote Config API supports the same elements that you can use to create conditions when configuring the Remote Config service 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 && , that element is treated as a condition.

Note: a space is required before and after the ampersands. For example: element1 && element2.

app.version Evaluates to TRUE or FALSE based on the value of an app's version number.
app.id An element based on the app's Firebase App ID
app.audiences An element that evaluates to TRUE or FALSE based on the user's presence or absence in one or more Firebase Analytics audience(s).
device.language An element based on the language installed on a device. The language is represented using an IETF Language tag such as es-ES, pt-BR, or en-US. Evaluates to TRUE when a country matches an expected language code.
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 TRUE when a country matches an expected country code.
device.os An element based on the operating system used on a device (iOS or Android). Evaluates to TRUE when the device OS is the expected type.
app.userProperty An element that evaluates to TRUE or FALSE based on the numeric or string value of a Firebase Analytics User Property.
percent Evaluates to TRUE based on a user's inclusion in a randomly assigned fractional percentile (with sample sizes as small as 0.000001%).

A single-element condition contains three fields:

  1. An arbitrarily-defined name (up to 100 characters)
  2. A conditional expression that evaluates to TRUE or FALSE, made up of the elements shown above.
  3. (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

For example, app.version.notContains([123, 456]) returns TRUE if the actual app version is 123 or 492, but returns FALSE if the actual app version is 999.
Element Supported operators Description
app.audiences .inAtLeastOne([...]) Returns TRUE if the actual audience matches at least one audience name in the list.
For example:

app.audiences.inAtLeastOne(['Audience 1', 'Audience 2'])

app.audiences .notInAtLeastOne([...]) Returns TRUE if the actual audience does not match at least one audience name in the list.
app.audiences .inAll([...]) Returns TRUE if the actual audience is a member of every audience name in the list.
app.audiences .notInAll([...]) Returns TRUE if the actual audience is not a member of any audience in the list.
app.userProperty <, <=, ==, >=, > Returns TRUE if the actual user property numerically compares to the value specified in a way that matches the operator.
app.userProperty .contains([...]) Returns TRUE if any of the target values is a substring of the actual user property.
app.userProperty .notContains([...]) Returns TRUE if none of the target values is a substring of the actual user property.
app.userProperty .exactlyMatches([...]) Returns TRUE if the actual user property exactly matches (case-sensitive) any of the target values in the list.
app.userProperty .matches([...]) Returns TRUE if any target regular expression in the list matches a substring of, or the entire, actual value. To force matching of the entire string, preface the regular expression with "^" and suffix it with "$". Uses RE2 syntax.
app.id == Returns TRUE if the value specified matches the app's App Id.
app.version .contains([...]) Returns TRUE if any of the target values is a substring of the actual app version—for example, "a" and "bc" are substrings of "abc".
app.version .notContains([...]) Returns TRUE if none of the target values is a substring of the actual app version.
app.version .exactlyMatches([...]) Returns TRUE if the actual app version exactly matches any of the target values in the list.
app.version .matches([...]) Returns TRUE if any target regular expression in the list matches a substring of, or the entire, actual value. To force matching of the entire string, preface the regular expression with "^" and suffix it with "$". Uses RE2 syntax.
device.country in [...] Returns TRUE if the device's country (determined using the device's current IP address) matches any specified in the list. Sample usage: device.country in ['gb', 'us'].
device.language in [...] Returns TRUE if any of the app's languages match a language in the list. Sample usage: device.language in ['en-UK', 'en-US'].
device.os ==, != Returns TRUE if the device's operating system compares to the value in that field matching the operator.
percent <=, > Returns TRUE if the value in the percent field compares to the value that was randomly assigned matching the operator.
app.predictions .inAtLeastOne([...]) Returns TRUE if the named target prediction risk profile ID is predicted. Currently, this condition only supports the targeting of one prediction risk profile ID. Sample usage: app.predictions.inAtLeastOne(['pred']); returns TRUE if 'pred' is predicted.

Parameters with empty strings and no value

When you create or edit parameter values in the Remote Config web console, you have the option to set a parameter value to a string value, (empty string), or to No value (which results in the in-app default value being used instead of the value in the Remote Config template).

When you use the Remote Config API to get the Remote Config template for your project in JSON format, No value is represented as shown below:

"myCondition" : {
  "useInAppDefault" : true
},

Similarly, (empty string) is represented as shown below:

"myCondition" : {
  "value" : ""
},

Send feedback about...

Need help? Visit our support page.