Skip to main content
Remote configuration is an Analytics Web feature. Every method on this page is a member of a GrainAnalytics instance. Every configuration value is a string. Read Remote configuration for the cache-first model. Every example below starts from this instance.

getConfig

The method returns without a request. It returns the cached value, then the value in defaultConfigurations, then undefined. It starts a background refresh.

getAllConfigs

This method has no parameters. It returns every cached key merged with defaultConfigurations, without a request.

getConfigAsync

If the cache holds the key and forceRefresh is not true, the promise resolves from the cache. Otherwise the client calls the API.

getAllConfigsAsync

fetchConfig

The method always calls the API and returns the full response. It resolves to null when the request fails.

preloadConfig

Call preloadConfig at application start, before the first render. After it resolves, getConfig returns the loaded values without a request.

addConfigChangeListener

The listener runs after a background refresh, after a manual fetchConfig or forceRefresh, and after every other cache update.

removeConfigChangeListener

When the component unmounts, remove the listener. Remove it before destroy too.

RemoteConfigOptions

RemoteConfigResponse