firebase-admin.remote-config package

Firebase Remote Config.

Functions

FunctionDescription
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

ClassDescription
RemoteConfigThe FirebaseRemoteConfig service interface.
RemoteConfigFetchResponseRepresents a fetch response that can be used to interact with RC's client SDK.

Enumerations

EnumerationDescription
CustomSignalOperatorDefines supported operators for custom signal conditions.
PercentConditionOperatorDefines supported operators for percent conditions.

Interfaces

InterfaceDescription
AndConditionRepresents a collection of conditions that evaluate to true if all are true.
CustomSignalConditionRepresents a condition that compares provided signals against a target value.
ExplicitParameterValueInterface representing an explicit parameter value.
FetchResponseDataJSON-serializable representation of evaluated config values. This can be consumed by Remote Config web client SDKs.
GetServerTemplateOptionsRepresents optional arguments that can be used when instantiatingServerTemplate.
InAppDefaultValueInterface representing an in-app-default value.
InitServerTemplateOptionsRepresents optional arguments that can be used when instantiatingServerTemplate synchronously.
ListVersionsOptionsInterface representing options for Remote Config list versions operation.
ListVersionsResultInterface representing a list of Remote Config template versions.
MicroPercentRangeRepresents the limit of percentiles to target in micro-percents. The value must be in the range [0 and 100000000]
NamedConditionRepresents 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.
OneOfConditionRepresents a condition that may be one of several types. Only the first defined field will be processed.
OrConditionRepresents a collection of conditions that evaluate to true if any are true.
PercentConditionRepresents a condition that compares the instance pseudo-random percentile to a given limit.
RemoteConfigConditionInterface 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.
RemoteConfigParameterInterface representing a Remote Config parameter. At minimum, adefaultValue or aconditionalValues entry must be present for the parameter to have any effect.
RemoteConfigParameterGroupInterface representing a Remote Config parameter group. Grouping parameters is only for management purposes and does not affect client-side fetching of parameter values.
RemoteConfigTemplateRepresents a Remote Config client template.
RemoteConfigUserInterface representing a Remote Config user.
ServerConfigRepresents the configuration produced by evaluating a server template.
ServerTemplateRepresents a stateful abstraction for a Remote Config server template.
ServerTemplateDataRepresents the data in a Remote Config server template.
ValueWraps a parameter value with metadata and type-safe getters.Type-safe getters insulate application logic from remote changes to parameter names and types.
VersionInterface 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 AliasDescription
DefaultConfigDefines the format for in-app default parameter values.
EvaluationContextRepresents template evaluation input signals.
ParameterValueTypeType representing a Remote Config parameter value data type. Defaults toSTRING if unspecified.
PredefinedSignalsPredefined template evaluation input signals.
RemoteConfigParameterValueType representing a Remote Config parameter value. ARemoteConfigParameterValue could be either anExplicitParameterValue or anInAppDefaultValue.
ServerTemplateDataTypeRepresents the type of a Remote Config server template that can be set onServerTemplate. This can either be aServerTemplateData object or a template JSON string.
TagColorColors that are associated with conditions for display purposes.
UserProvidedSignalsGeneric map of developer-defined signals used as evaluation input signals.
ValueSourceIndicates 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.

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

ParameterTypeDescription
appAppOptional app for which to return theRemoteConfig service. If not provided, the defaultRemoteConfig service is returned.

Returns:

RemoteConfig

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:

exportdeclareenumCustomSignalOperator

Enumeration Members

MemberValueDescription
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:

exportdeclareenumPercentConditionOperator

Enumeration Members

MemberValueDescription
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.