const remoteConfig = new RemoteConfig(app, {
fetchTimeout: 60 * 1000, // optional, limits an individual fetch, defaults to one minute
cacheMaxAge: 12 * 60 * 60 * 1000, // optional, also drives the auto refresh interval, defaults to twelve hours
languageCode: 'en-GB', // optional
defaultConfig: {}, // optional, served when a key has no remote value
})Fetching starts automatically once the instance is constructed, and again on every cacheMaxAge interval.
fetch- emitted when config fetch is calledactivate- emitted when new config is downloaded from remote server and saved in storage
fetchAndActivate- attempts to download config from remote server if cache is missing or invalid; concurrent calls share one requestgetValue- Returns instance ofValuefor given keygetAll- Returns all properties as collection ofValueinstancesgetAllConverted- Returns all properties converted into their "best guess" typesdestroy- clears automatic refresh and aborts an in-flight request
defaultConfig- readable and writable, the default config served when a key has no remote valueisCacheValid-truewhen a config is stored and younger thancacheMaxAge
Background fetch failures are reported through the app logger.