The Firebase RemoteConfig service interface.

Signature:

export declare class RemoteConfig 

Properties

Property Modifiers Type Description
app App

Methods

Method Modifiers Description
createTemplateFromJSON(json) Creates and returns a new Remote Config template from a JSON string.
getTemplate() Gets the current active version of the of the project. A promise that fulfills with a RemoteConfigTemplate.
getTemplateAtVersion(versionNumber) Gets the requested version of the of the project.
listVersions(options) Gets a list of Remote Config template versions that have been published, sorted in reverse chronological order. Only the last 300 versions are stored. All versions that correspond to non-active Remote Config templates (i.e., all except the template that is being fetched by clients) are also deleted if they are older than 90 days.
publishTemplate(template, options) Publishes a Remote Config template.
rollback(versionNumber) Rolls back a project's published Remote Config template to the specified version. A rollback is equivalent to getting a previously published Remote Config template and re-publishing it using a force update.
validateTemplate(template) Validates a .

RemoteConfig.app

Signature:

readonly app: App;

RemoteConfig.createTemplateFromJSON()

Creates and returns a new Remote Config template from a JSON string.

Signature:

createTemplateFromJSON(json: string): RemoteConfigTemplate;

Parameters

Parameter Type Description
json string The JSON string to populate a Remote Config template. A new template instance.

Returns:

RemoteConfigTemplate

RemoteConfig.getTemplate()

Gets the current active version of the of the project.

A promise that fulfills with a RemoteConfigTemplate.

Signature:

getTemplate(): Promise<RemoteConfigTemplate>;

Returns:

Promise<RemoteConfigTemplate>

RemoteConfig.getTemplateAtVersion()

Gets the requested version of the of the project.

Signature:

getTemplateAtVersion(versionNumber: number | string): Promise<RemoteConfigTemplate>;

Parameters

Parameter Type Description
versionNumber number | string Version number of the Remote Config template to look up. A promise that fulfills with a RemoteConfigTemplate.

Returns:

Promise<RemoteConfigTemplate>

RemoteConfig.listVersions()

Gets a list of Remote Config template versions that have been published, sorted in reverse chronological order. Only the last 300 versions are stored. All versions that correspond to non-active Remote Config templates (i.e., all except the template that is being fetched by clients) are also deleted if they are older than 90 days.

Signature:

listVersions(options?: ListVersionsOptions): Promise<ListVersionsResult>;

Parameters

Parameter Type Description
options ListVersionsOptions Optional options object for getting a list of versions. A promise that fulfills with a ListVersionsResult.

Returns:

Promise<ListVersionsResult>

RemoteConfig.publishTemplate()

Publishes a Remote Config template.

Signature:

publishTemplate(template: RemoteConfigTemplate, options?: {
        force: boolean;
    }): Promise<RemoteConfigTemplate>;

Parameters

Parameter Type Description
template RemoteConfigTemplate The Remote Config template to be published.
options Optional options object when publishing a Remote Config template: - {boolean} force Setting this to true forces the Remote Config template to be updated and circumvent the ETag. This approach is not recommended because it risks causing the loss of updates to your Remote Config template if multiple clients are updating the Remote Config template. See . A Promise that fulfills with the published RemoteConfigTemplate.

Returns:

Promise<RemoteConfigTemplate>

RemoteConfig.rollback()

Rolls back a project's published Remote Config template to the specified version. A rollback is equivalent to getting a previously published Remote Config template and re-publishing it using a force update.

Signature:

rollback(versionNumber: number | string): Promise<RemoteConfigTemplate>;

Parameters

Parameter Type Description
versionNumber number | string The version number of the Remote Config template to roll back to. The specified version number must be lower than the current version number, and not have been deleted due to staleness. Only the last 300 versions are stored. All versions that correspond to non-active Remote Config templates (that is, all except the template that is being fetched by clients) are also deleted if they are more than 90 days old. A promise that fulfills with the published RemoteConfigTemplate.

Returns:

Promise<RemoteConfigTemplate>

RemoteConfig.validateTemplate()

Validates a .

Signature:

validateTemplate(template: RemoteConfigTemplate): Promise<RemoteConfigTemplate>;

Parameters

Parameter Type Description
template RemoteConfigTemplate The Remote Config template to be validated.

Returns:

Promise<RemoteConfigTemplate>

A promise that fulfills with the validated RemoteConfigTemplate.