Remote Config templates are sets of JSON-formatted parameters and conditions that you have created for your Firebase project. You can create client templates, from which your app fetches values, and server templates, from which server clients can fetch values.
This section discusses server templates. To learn about client-specific templates, click Client templates.You can use the Firebase console to modify and manage the template. Go to DevOps & Engagement > Remote Config to view the contents of the template in graphical format in the Parameters page and Conditions page.
Here's an example of a server template file:
{
"parameters": {
"preamble_prompt": {
"defaultValue": {
"value": "You are a helpful assistant who knows everything there is to know about Firebase! "
},
"description": "Add this prompt to the user's prompt",
"valueType": "STRING"
},
"model_name": {
"defaultValue": {
"value": "gemini-pro-test"
},
"valueType": "STRING"
},
"generation_config": {
"defaultValue": {
"value": "{\"temperature\": 0.9, \"maxOutputTokens\": 2048, \"topP\": 0.9, \"topK\": 20}"
},
"valueType": "JSON"
},
},
"version": {
"versionNumber": "19",
"isLegacy": true
}
}
You can perform these version management tasks in the Firebase console (navigate to DevOps & Engagement > Remote Config):
- List all stored template versions
- Retrieve a specific version
- Roll back to a specific client version
- Delete Remote Config templates from the Change history page.
There is a total limit of 300 lifetime stored versions per template type (300 client templates and 300 server templates), which includes stored version numbers for deleted templates. If you publish more than 300 template versions per template type during the lifetime of a project, the earliest versions are deleted, maintaining a maximum of 300 versions of that type.
Each time you update parameters, Remote Config creates a
new versioned Remote Config template and stores the previous template as
a version that you can retrieve or roll back to as needed. Version numbers
are incremented sequentially from the initial value stored by Remote Config.
All templates include a version field as shown, containing metadata about that
specific version.
You can delete Remote Config templates as-needed in the DevOps & Engagement > Remote Config > Change history page of the Firebase console.
Manage Remote Config template versions
This section describes how to manage versions of your Remote Config template.
List all stored versions of the Remote Config template
You can retrieve a list of all stored versions of the Remote Config template. To do this:
In the Firebase console, go to the DevOps & Engagement > Remote Config > Parameters page.
Select the "clock" icon displayed at top right.
This opens the Change history page which lists all stored template versions in a list menu at the right.
The list of templates includes metadata for all stored versions, including the time of the update, the user who made it, and how it was made.
Retrieve a specific version of the Remote Config template
You can retrieve any specific stored version of the Remote Config template. Here's how to retrieve a stored template version:
In the Firebase console, go to the DevOps & Engagement > Remote Config > Change history page.
By default, the page displays the current active template. To view a different version, select it from the details pane on the right.
View a detailed diff of the active template and any other stored version by hovering over the context menu for any non-selected version and selecting Compare with selected version.
Roll back to a specific stored version of the Remote Config template
You can roll back to any stored version of the template. Here's how to roll back a template:
In the Firebase console, go to the DevOps & Engagement > Remote Config > Change history page.
Locate the option button at the top right of the page for previous template versions eligible for rollback.
Click and confirm this only if you are sure you want to roll back to that version and use those values immediately for all apps and users.
Note that this rollback operation effectively creates a new numbered version. For example, rolling back from version 10 to version 6 effectively creates a new copy of version 6, differing from the original only in that its version number is 11. The original version 6 is still stored, assuming it has not reached its expiration, and version 11 becomes the active template.
Delete a Remote Config template
You can delete Remote Config templates using the Firebase console. Here's how to delete a template:
In the Firebase console, go to the DevOps & Engagement > Remote Config > Parameters page.
Click
Change history .Toggle to the template you want to delete, click
More , then select Delete.When prompted to confirm the deletion, click Delete.
Download and publish Remote Config templates
Download and publish Remote Config templates to integrate them into your source control and build systems, automate config updates, and keep parameters and values in sync across multiple projects.
You can download the currently active Remote Config template from the Firebase console. You can then update the exported JSON file and publish it to the same project, or publish it to a new or existing project.
Let's say you have multiple projects that represent different stages of your software development lifecycle, like development, test, staging, and production environments. In this case, you could promote a fully-tested template from your staging environment to your production environment by downloading it from your staging project and publishing it to your production project.
You can also use this method to migrate configurations from one project to another, or populate a new project with parameters and values from an established project.
Parameters and parameter values created specifically as variants in an A/B Testing experiment are not included in exported templates.
To export and import Remote Config templates:
- Download the current Remote Config Config template.
- Validate the Remote Config template.
- Publish the Remote Config template.
Download the current Remote Config Template
Use the following to download the active Remote Config template in JSON format:
In the Firebase console, go to the DevOps & Engagement > Remote Config > Parameters or Conditions page.
Open the
Menu , and select Download current config file.When prompted, click Download config file, choose the location where you want to save the file, then click Save.
Validate the Remote Config template
Server templates are validated when you attempt to publish from the Firebase console. Note that User in Random Percentage conditions can be imported, but any unsupported condition will generate an error during upload. If you're attempting to publish a template that was originally exported from a client template, be sure to remove any client-specific conditions first.
Publish the Remote Config template
After downloading a template, making any needed changes to the JSON content, and validating it, you can publish it to a project.
Publishing a template replaces the entire existing config template with the updated file and increments the template version by one. Because the entire configuration is replaced, if you delete a parameter from the JSON file and publish it, the parameter is deleted from the server and is no longer available to clients.
After publishing, changes to parameters and values are immediately available to your apps and users. If necessary, you can roll back to a previous version.
Use the following commands to publish your template:
In the Firebase console, go to the DevOps & Engagement > Remote Config > Parameters or Conditions page.
Open the
Menu , and select Publish from a file.When prompted, click Browse, navigate to and select the Remote Config file you want to publish, then click Select.
The file will be validated and, if successful, you can click Publish to make the configuration immediately available to your apps and users.
Next steps
- Learn more about using Remote Config in server environments.
- Try server-side Remote Config with Cloud Functions and Vertex AI.