firebase-admin.remote-config package

Firebase Remote Config.

Functions

Function Description
getRemoteConfig(app) Gets the RemoteConfig service for the default app or a given app.getRemoteConfig() can be called with no arguments to access the default app's RemoteConfig service or as getRemoteConfig(app) to access the RemoteConfig service associated with a specific app.

Classes

Class Description
RemoteConfig The Firebase RemoteConfig service interface.

Enumerations

Enumeration Description
PercentConditionOperator Defines supported operators for percent conditions.

Interfaces

Interface Description
AndCondition Represents a collection of conditions that evaluate to true if all are true.
ExplicitParameterValue Interface representing an explicit parameter value.
GetServerTemplateOptions Represents optional arguments that can be used when instantiating ServerTemplate.
InAppDefaultValue Interface representing an in-app-default value.
InitServerTemplateOptions Represents optional arguments that can be used when instantiating ServerTemplate synchonously.
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, a defaultValue or a conditionalValues 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 in publishTemplate 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 to STRING if unspecified.
RemoteConfigParameterValue Type representing a Remote Config parameter value. A RemoteConfigParameterValue could be either an ExplicitParameterValue or an InAppDefaultValue.
ServerTemplateDataType Represents the type of a Remote Config server template that can be set on ServerTemplate. This can either be a ServerTemplateData object or a template JSON string.
TagColor Colors that are associated with conditions for display purposes.
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.

getRemoteConfig(app)

Gets the RemoteConfig service for the default app or a given app.

getRemoteConfig() can be called with no arguments to access the default app's RemoteConfig service or as getRemoteConfig(app) to access the RemoteConfig service associated with a specific app.

Signature:

export declare function getRemoteConfig(app?: App): RemoteConfig;

Parameters

Parameter Type Description
app App Optional app for which to return the RemoteConfig service. If not provided, the default RemoteConfig service is returned.

Returns:

RemoteConfig

The default RemoteConfig service if no app is provided, or the RemoteConfig service associated with the provided app.

Example 1

// Get the `RemoteConfig` service for the default app
const defaultRemoteConfig = getRemoteConfig();

Example 2

// Get the `RemoteConfig` service for a given app
const otherRemoteConfig = getRemoteConfig(otherApp);

DefaultConfig

Defines the format for in-app default parameter values.

Signature:

export type DefaultConfig = {
    [key: string]: string | number | boolean;
};

EvaluationContext

Represents template evaluation input signals.

Signature:

export type EvaluationContext = {
    randomizationId?: string;
};

ParameterValueType

Type representing a Remote Config parameter value data type. Defaults to STRING if unspecified.

Signature:

export type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON';

RemoteConfigParameterValue

Type representing a Remote Config parameter value. A RemoteConfigParameterValue could be either an ExplicitParameterValue or an InAppDefaultValue.

Signature:

export type RemoteConfigParameterValue = ExplicitParameterValue | InAppDefaultValue;

ServerTemplateDataType

Represents the type of a Remote Config server template that can be set on ServerTemplate. This can either be a ServerTemplateData object or a template JSON string.

Signature:

export type ServerTemplateDataType = ServerTemplateData | string;

TagColor

Colors that are associated with conditions for display purposes.

Signature:

export type TagColor = 'BLUE' | 'BROWN' | 'CYAN' | 'DEEP_ORANGE' | 'GREEN' | 'INDIGO' | 'LIME' | 'ORANGE' | 'PINK' | 'PURPLE' | 'TEAL';

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:

export type ValueSource = 'static' | 'default' | 'remote';

PercentConditionOperator

Defines supported operators for percent conditions.

Signature:

export declare enum PercentConditionOperator 

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