firebase-admin.remote-config package Stay organized with collections Save and categorize content based on your preferences.
Firebase Remote Config.
Functions
| Function | Description |
|---|---|
| getRemoteConfig(app) | Gets theRemoteConfig service for the default app or a given app.getRemoteConfig() can be called with no arguments to access the default app'sRemoteConfig service or asgetRemoteConfig(app) to access theRemoteConfig service associated with a specific app. |
Classes
| Class | Description |
|---|---|
| RemoteConfig | The FirebaseRemoteConfig service interface. |
| RemoteConfigFetchResponse | Represents a fetch response that can be used to interact with RC's client SDK. |
Enumerations
| Enumeration | Description |
|---|---|
| CustomSignalOperator | Defines supported operators for custom signal conditions. |
| PercentConditionOperator | Defines supported operators for percent conditions. |
Interfaces
| Interface | Description |
|---|---|
| AndCondition | Represents a collection of conditions that evaluate to true if all are true. |
| CustomSignalCondition | Represents a condition that compares provided signals against a target value. |
| ExplicitParameterValue | Interface representing an explicit parameter value. |
| FetchResponseData | JSON-serializable representation of evaluated config values. This can be consumed by Remote Config web client SDKs. |
| GetServerTemplateOptions | Represents optional arguments that can be used when instantiatingServerTemplate. |
| InAppDefaultValue | Interface representing an in-app-default value. |
| InitServerTemplateOptions | Represents optional arguments that can be used when instantiatingServerTemplate synchronously. |
| ListVersionsOptions | Interface representing options for Remote Config list versions operation. |
| ListVersionsResult | Interface representing a list of Remote Config template versions. |
| MicroPercentRange | Represents the limit of percentiles to target in micro-percents. The value must be in the range [0 and 100000000] |
| NamedCondition | Represents a Remote Config condition in the dataplane. A condition targets a specific group of users. A list of these conditions comprise part of a Remote Config template. |
| OneOfCondition | Represents a condition that may be one of several types. Only the first defined field will be processed. |
| OrCondition | Represents a collection of conditions that evaluate to true if any are true. |
| PercentCondition | Represents a condition that compares the instance pseudo-random percentile to a given limit. |
| RemoteConfigCondition | Interface representing a Remote Config condition. A condition targets a specific group of users. A list of these conditions make up part of a Remote Config template. |
| RemoteConfigParameter | Interface representing a Remote Config parameter. At minimum, adefaultValue or aconditionalValues entry must be present for the parameter to have any effect. |
| RemoteConfigParameterGroup | Interface representing a Remote Config parameter group. Grouping parameters is only for management purposes and does not affect client-side fetching of parameter values. |
| RemoteConfigTemplate | Represents a Remote Config client template. |
| RemoteConfigUser | Interface representing a Remote Config user. |
| ServerConfig | Represents the configuration produced by evaluating a server template. |
| ServerTemplate | Represents a stateful abstraction for a Remote Config server template. |
| ServerTemplateData | Represents the data in a Remote Config server template. |
| Value | Wraps a parameter value with metadata and type-safe getters.Type-safe getters insulate application logic from remote changes to parameter names and types. |
| Version | Interface representing a Remote Config template version. Output only, except for the version description. Contains metadata about a particular version of the Remote Config template. All fields are set at the time the specified Remote Config template is published. A version's description field may be specified inpublishTemplate calls. |
Type Aliases
| Type Alias | Description |
|---|---|
| DefaultConfig | Defines the format for in-app default parameter values. |
| EvaluationContext | Represents template evaluation input signals. |
| ParameterValueType | Type representing a Remote Config parameter value data type. Defaults toSTRING if unspecified. |
| PredefinedSignals | Predefined template evaluation input signals. |
| RemoteConfigParameterValue | Type representing a Remote Config parameter value. ARemoteConfigParameterValue could be either anExplicitParameterValue or anInAppDefaultValue. |
| ServerTemplateDataType | Represents the type of a Remote Config server template that can be set onServerTemplate. This can either be aServerTemplateData object or a template JSON string. |
| TagColor | Colors that are associated with conditions for display purposes. |
| UserProvidedSignals | Generic map of developer-defined signals used as evaluation input signals. |
| ValueSource | Indicates the source of a value.
|
getRemoteConfig(app)
Gets theRemoteConfig service for the default app or a given app.
getRemoteConfig() can be called with no arguments to access the default app'sRemoteConfig service or asgetRemoteConfig(app) to access theRemoteConfig service associated with a specific app.
Signature:
exportdeclarefunctiongetRemoteConfig(app?:App):RemoteConfig;Parameters
| Parameter | Type | Description |
|---|---|---|
| app | App | Optional app for which to return theRemoteConfig service. If not provided, the defaultRemoteConfig service is returned. |
Returns:
The defaultRemoteConfig service if no app is provided, or theRemoteConfig service associated with the provided app.
Example 1
// Get the `RemoteConfig` service for the default appconstdefaultRemoteConfig=getRemoteConfig();Example 2
// Get the `RemoteConfig` service for a given appconstotherRemoteConfig=getRemoteConfig(otherApp);DefaultConfig
Defines the format for in-app default parameter values.
Signature:
exporttypeDefaultConfig={[key:string]:string|number|boolean;};EvaluationContext
Represents template evaluation input signals.
Signature:
exporttypeEvaluationContext=UserProvidedSignals &PredefinedSignals;ParameterValueType
Type representing a Remote Config parameter value data type. Defaults toSTRING if unspecified.
Signature:
exporttypeParameterValueType='STRING'|'BOOLEAN'|'NUMBER'|'JSON';PredefinedSignals
Predefined template evaluation input signals.
Signature:
exporttypePredefinedSignals={randomizationId?:string;};RemoteConfigParameterValue
Type representing a Remote Config parameter value. ARemoteConfigParameterValue could be either anExplicitParameterValue or anInAppDefaultValue.
Signature:
exporttypeRemoteConfigParameterValue=ExplicitParameterValue|InAppDefaultValue;ServerTemplateDataType
Represents the type of a Remote Config server template that can be set onServerTemplate. This can either be aServerTemplateData object or a template JSON string.
Signature:
exporttypeServerTemplateDataType=ServerTemplateData|string;TagColor
Colors that are associated with conditions for display purposes.
Signature:
exporttypeTagColor='BLUE'|'BROWN'|'CYAN'|'DEEP_ORANGE'|'GREEN'|'INDIGO'|'LIME'|'ORANGE'|'PINK'|'PURPLE'|'TEAL';UserProvidedSignals
Generic map of developer-defined signals used as evaluation input signals.
Signature:
exporttypeUserProvidedSignals={[key:string]:string|number;};ValueSource
Indicates the source of a value.
- "static" indicates the value was defined by a static constant.
- "default" indicates the value was defined by default config.
- "remote" indicates the value was defined by config produced by evaluating a template.
Signature:
exporttypeValueSource='static'|'default'|'remote';CustomSignalOperator
Defines supported operators for custom signal conditions.
Signature:
exportdeclareenumCustomSignalOperatorEnumeration Members
| Member | Value | Description |
|---|---|---|
| NUMERIC_EQUAL | "NUMERIC_EQUAL" | Matches a numeric value equal to the target value. |
| NUMERIC_GREATER_EQUAL | "NUMERIC_GREATER_EQUAL" | Matches a numeric value greater than or equal to the target value. |
| NUMERIC_GREATER_THAN | "NUMERIC_GREATER_THAN" | Matches a numeric value greater than the target value. |
| NUMERIC_LESS_EQUAL | "NUMERIC_LESS_EQUAL" | Matches a numeric value less than or equal to the target value. |
| NUMERIC_LESS_THAN | "NUMERIC_LESS_THAN" | Matches a numeric value less than the target value. |
| NUMERIC_NOT_EQUAL | "NUMERIC_NOT_EQUAL" | Matches a numeric value not equal to the target value. |
| SEMANTIC_VERSION_EQUAL | "SEMANTIC_VERSION_EQUAL" | Matches if the actual version value is equal to the target value. |
| SEMANTIC_VERSION_GREATER_EQUAL | "SEMANTIC_VERSION_GREATER_EQUAL" | Matches if the actual version value is greater than or equal to the target value. |
| SEMANTIC_VERSION_GREATER_THAN | "SEMANTIC_VERSION_GREATER_THAN" | Matches if the actual version value is greater than the target value. |
| SEMANTIC_VERSION_LESS_EQUAL | "SEMANTIC_VERSION_LESS_EQUAL" | Matches if the actual version value is less than or equal to the target value. |
| SEMANTIC_VERSION_LESS_THAN | "SEMANTIC_VERSION_LESS_THAN" | Matches if the actual version value is less than the target value. |
| SEMANTIC_VERSION_NOT_EQUAL | "SEMANTIC_VERSION_NOT_EQUAL" | Matches if the actual version value is not equal to the target value. |
| STRING_CONTAINS | "STRING_CONTAINS" | Matches if at least one of the target values is a substring of the actual custom signal value (e.g. "abc" contains the string "a", "bc"). |
| STRING_CONTAINS_REGEX | "STRING_CONTAINS_REGEX" | The target regular expression matches at least one of the actual values. The regex conforms to RE2 format. See https://github.com/google/re2/wiki/Syntax |
| STRING_DOES_NOT_CONTAIN | "STRING_DOES_NOT_CONTAIN" | Matches if none of the target values is a substring of the actual custom signal value. |
| STRING_EXACTLY_MATCHES | "STRING_EXACTLY_MATCHES" | Matches if the actual value exactly matches at least one of the target values. |
| UNKNOWN | "UNKNOWN" | A catchall error case. |
PercentConditionOperator
Defines supported operators for percent conditions.
Signature:
exportdeclareenumPercentConditionOperatorEnumeration Members
| Member | Value | Description |
|---|---|---|
| BETWEEN | "BETWEEN" | Target percentiles within an interval defined by a lower bound and an upper bound. The lower bound is an exclusive (open) bound and the micro_percent_range_upper_bound is an inclusive (closed) bound. A condition using this operator must specify microPercentRange. |
| GREATER_THAN | "GREATER_THAN" | Target percentiles greater than the target percent. A condition using this operator must specify microPercent. |
| LESS_OR_EQUAL | "LESS_OR_EQUAL" | Target percentiles less than or equal to the target percent. A condition using this operator must specify microPercent. |
| UNKNOWN | "UNKNOWN" | A catchall error case. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-05 UTC.