remote-config package

The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment.

Functions

FunctionDescription
function(app, ...)
getRemoteConfig(app, options)
function(remoteConfig, ...)
activate(remoteConfig)Makes the last fetched config available to the getters.
ensureInitialized(remoteConfig)Ensures the last activated config are available to the getters.
fetchAndActivate(remoteConfig)Performs fetch and activate operations, as a convenience.
fetchConfig(remoteConfig)Fetches and caches configuration from the Remote Config service.
getAll(remoteConfig)Gets all config.
getBoolean(remoteConfig, key)Gets the value for the given key as a boolean.Convenience method for callingremoteConfig.getValue(key).asBoolean().
getNumber(remoteConfig, key)Gets the value for the given key as a number.Convenience method for callingremoteConfig.getValue(key).asNumber().
getString(remoteConfig, key)Gets the value for the given key as a string. Convenience method for callingremoteConfig.getValue(key).asString().
getValue(remoteConfig, key)Gets theValue for the given key.
onConfigUpdate(remoteConfig, observer)Starts listening for real-time config updates from the Remote Config backend and automatically fetches updates from the Remote Config backend when they are available.
setCustomSignals(remoteConfig, customSignals)Sets the custom signals for the app instance.
setLogLevel(remoteConfig, logLevel)Defines the log level to use.
function()
isSupported()This method provides two different checks:1. Check if IndexedDB exists in the browser environment. 2. Check if the current browser context allows IndexedDBopen() calls.

Interfaces

InterfaceDescription
ConfigUpdateContains information about which keys have been updated.
ConfigUpdateObserverObserver interface for receiving real-time Remote Config update notifications.NOTE: Although ancomplete callback can be provided, it will never be called because the ConfigUpdate stream is never-ending.
CustomSignalsDefines the type for representing custom signals and their values.

The values in CustomSignals must be one of the following types:

  • string
  • number
  • null
FetchResponseDefines a successful response (200 or 304).

Modeled after the nativeResponse interface, but simplified for Remote Config's use case.

FirebaseExperimentDescriptionDefines experiment and variant attached to a config parameter.
FirebaseRemoteConfigObjectDefines a self-descriptive reference for config key-value pairs.
RemoteConfigThe Firebase Remote Config service interface.
RemoteConfigOptionsOptions for Remote Config initialization.
RemoteConfigSettingsDefines configuration options for the Remote Config SDK.
ValueWraps a value with metadata and type-safe getters.

Type Aliases

Type AliasDescription
FetchStatusSummarizes the outcome of the last attempt to fetch config from the Firebase Remote Config server.
  • "no-fetch-yet" indicates theRemoteConfig instance has not yet attempted to fetch config, or that SDK initialization is incomplete.
  • "success" indicates the last attempt succeeded.
  • "failure" indicates the last attempt failed.
  • "throttle" indicates the last attempt was rate-limited.
FetchTypeIndicates the type of fetch request.
  • "BASE" indicates a standard fetch request.
  • "REALTIME" indicates a fetch request triggered by a real-time update.
LogLevelDefines levels of Remote Config logging.
UnsubscribeA function that unsubscribes from a real-time event stream.
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 fetched config.

function(app, ...)

getRemoteConfig(app, options)

Signature:

exportdeclarefunctiongetRemoteConfig(app?:FirebaseApp,options?:RemoteConfigOptions):RemoteConfig;

Parameters

ParameterTypeDescription
appFirebaseAppTheFirebaseApp instance.
optionsRemoteConfigOptionsOptional. TheRemoteConfigOptions with which to instantiate the Remote Config instance.

Returns:

RemoteConfig

ARemoteConfig instance.

function(remoteConfig, ...)

activate(remoteConfig)

Makes the last fetched config available to the getters.

Signature:

exportdeclarefunctionactivate(remoteConfig:RemoteConfig):Promise<boolean>;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.

Returns:

Promise<boolean>

APromise which resolves to true if the current call activated the fetched configs. If the fetched configs were already activated, thePromise will resolve to false.

ensureInitialized(remoteConfig)

Ensures the last activated config are available to the getters.

Signature:

exportdeclarefunctionensureInitialized(remoteConfig:RemoteConfig):Promise<void>;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.

Returns:

Promise<void>

APromise that resolves when the last activated config is available to the getters.

fetchAndActivate(remoteConfig)

Performs fetch and activate operations, as a convenience.

Signature:

exportdeclarefunctionfetchAndActivate(remoteConfig:RemoteConfig):Promise<boolean>;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.

Returns:

Promise<boolean>

APromise which resolves to true if the current call activated the fetched configs. If the fetched configs were already activated, thePromise will resolve to false.

fetchConfig(remoteConfig)

Fetches and caches configuration from the Remote Config service.

Signature:

exportdeclarefunctionfetchConfig(remoteConfig:RemoteConfig):Promise<void>;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.

Returns:

Promise<void>

getAll(remoteConfig)

Gets all config.

Signature:

exportdeclarefunctiongetAll(remoteConfig:RemoteConfig):Record<string,Value>;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.

Returns:

Record<string,Value>

All config.

getBoolean(remoteConfig, key)

Gets the value for the given key as a boolean.

Convenience method for callingremoteConfig.getValue(key).asBoolean().

Signature:

exportdeclarefunctiongetBoolean(remoteConfig:RemoteConfig,key:string):boolean;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.
keystringThe name of the parameter.

Returns:

boolean

The value for the given key as a boolean.

getNumber(remoteConfig, key)

Gets the value for the given key as a number.

Convenience method for callingremoteConfig.getValue(key).asNumber().

Signature:

exportdeclarefunctiongetNumber(remoteConfig:RemoteConfig,key:string):number;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.
keystringThe name of the parameter.

Returns:

number

The value for the given key as a number.

getString(remoteConfig, key)

Gets the value for the given key as a string. Convenience method for callingremoteConfig.getValue(key).asString().

Signature:

exportdeclarefunctiongetString(remoteConfig:RemoteConfig,key:string):string;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.
keystringThe name of the parameter.

Returns:

string

The value for the given key as a string.

getValue(remoteConfig, key)

Gets theValue for the given key.

Signature:

exportdeclarefunctiongetValue(remoteConfig:RemoteConfig,key:string):Value;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.
keystringThe name of the parameter.

Returns:

Value

The value for the given key.

onConfigUpdate(remoteConfig, observer)

Starts listening for real-time config updates from the Remote Config backend and automatically fetches updates from the Remote Config backend when they are available.

If a connection to the Remote Config backend is not already open, calling this method will open it. Multiple listeners can be added by calling this method again, but subsequent calls re-use the same connection to the backend.

Signature:

exportdeclarefunctiononConfigUpdate(remoteConfig:RemoteConfig,observer:ConfigUpdateObserver):Unsubscribe;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.
observerConfigUpdateObserverTheConfigUpdateObserver to be notified of config updates.

Returns:

Unsubscribe

AnUnsubscribe function to remove the listener.

setCustomSignals(remoteConfig, customSignals)

Sets the custom signals for the app instance.

Signature:

exportdeclarefunctionsetCustomSignals(remoteConfig:RemoteConfig,customSignals:CustomSignals):Promise<void>;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.
customSignalsCustomSignalsMap (key, value) of the custom signals to be set for the app instance. If a key already exists, the value is overwritten. Setting the value of a custom signal to null unsets the signal. The signals will be persisted locally on the client.

Returns:

Promise<void>

setLogLevel(remoteConfig, logLevel)

Defines the log level to use.

Signature:

exportdeclarefunctionsetLogLevel(remoteConfig:RemoteConfig,logLevel:RemoteConfigLogLevel):void;

Parameters

ParameterTypeDescription
remoteConfigRemoteConfigTheRemoteConfig instance.
logLevelRemoteConfigLogLevelThe log level to set.

Returns:

void

function()

isSupported()

This method provides two different checks:

  1. Check if IndexedDB exists in the browser environment. 2. Check if the current browser context allows IndexedDBopen() calls.

Signature:

exportdeclarefunctionisSupported():Promise<boolean>;

Returns:

Promise<boolean>

APromise which resolves to true if aRemoteConfig instance can be initialized in this environment, or false if it cannot.

FetchStatus

Summarizes the outcome of the last attempt to fetch config from the Firebase Remote Config server.

  • "no-fetch-yet" indicates the [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) instance has not yet attempted to fetch config, or that SDK initialization is incomplete.
  • "success" indicates the last attempt succeeded.
  • "failure" indicates the last attempt failed.
  • "throttle" indicates the last attempt was rate-limited.

Signature:

exporttypeFetchStatus='no-fetch-yet'|'success'|'failure'|'throttle';

FetchType

Indicates the type of fetch request.

  • "BASE" indicates a standard fetch request.
  • "REALTIME" indicates a fetch request triggered by a real-time update.

Signature:

exporttypeFetchType='BASE'|'REALTIME';

LogLevel

Defines levels of Remote Config logging.

Signature:

exporttypeLogLevel='debug'|'error'|'silent';

Unsubscribe

A function that unsubscribes from a real-time event stream.

Signature:

exporttypeUnsubscribe=()=>void;

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 fetched config.

Signature:

exporttypeValueSource='static'|'default'|'remote';

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 2026-01-15 UTC.