remote-config package Stay organized with collections Save and categorize content based on your preferences.
The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment.
Functions
| Function | Description |
|---|---|
| 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
| Interface | Description |
|---|---|
| ConfigUpdate | Contains information about which keys have been updated. |
| ConfigUpdateObserver | Observer 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. |
| CustomSignals | Defines the type for representing custom signals and their values. The values in CustomSignals must be one of the following types:
|
| FetchResponse | Defines a successful response (200 or 304). Modeled after the native |
| FirebaseExperimentDescription | Defines experiment and variant attached to a config parameter. |
| FirebaseRemoteConfigObject | Defines a self-descriptive reference for config key-value pairs. |
| RemoteConfig | The Firebase Remote Config service interface. |
| RemoteConfigOptions | Options for Remote Config initialization. |
| RemoteConfigSettings | Defines configuration options for the Remote Config SDK. |
| Value | Wraps a value with metadata and type-safe getters. |
Type Aliases
| Type Alias | Description |
|---|---|
| FetchStatus | Summarizes the outcome of the last attempt to fetch config from the Firebase Remote Config server.
|
| FetchType | Indicates the type of fetch request.
|
| LogLevel | Defines levels of Remote Config logging. |
| Unsubscribe | A function that unsubscribes from a real-time event stream. |
| ValueSource | Indicates the source of a value.
|
function(app, ...)
getRemoteConfig(app, options)
Signature:
exportdeclarefunctiongetRemoteConfig(app?:FirebaseApp,options?:RemoteConfigOptions):RemoteConfig;Parameters
| Parameter | Type | Description |
|---|---|---|
| app | FirebaseApp | TheFirebaseApp instance. |
| options | RemoteConfigOptions | Optional. TheRemoteConfigOptions with which to instantiate the Remote Config instance. |
Returns:
ARemoteConfig instance.
function(remoteConfig, ...)
activate(remoteConfig)
Makes the last fetched config available to the getters.
Signature:
exportdeclarefunctionactivate(remoteConfig:RemoteConfig):Promise<boolean>;Parameters
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig 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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig 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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig 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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
Returns:
Promise<void>
getAll(remoteConfig)
Gets all config.
Signature:
exportdeclarefunctiongetAll(remoteConfig:RemoteConfig):Record<string,Value>;Parameters
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig 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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
| key | string | The 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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
| key | string | The 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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
| key | string | The 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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
| key | string | The name of the parameter. |
Returns:
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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
| observer | ConfigUpdateObserver | TheConfigUpdateObserver to be notified of config updates. |
Returns:
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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
| customSignals | CustomSignals | Map (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
| Parameter | Type | Description |
|---|---|---|
| remoteConfig | RemoteConfig | TheRemoteConfig instance. |
| logLevel | RemoteConfigLogLevel | The log level to set. |
Returns:
void
function()
isSupported()
This method provides two different checks:
- Check if IndexedDB exists in the browser environment. 2. Check if the current browser context allows IndexedDB
open()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.