|---|---|
| **Select template type:** | [Client templates](https://firebase.google.com/docs/remote-config/templates/client.md.txt) [Server templates](https://firebase.google.com/docs/remote-config/templates/server.md.txt) |

<br />

> [!WARNING]
>
> **Preview** : Using Remote Config in server environments is a feature
> that's in Preview, which means that it isn't subject to any SLA or
> deprecation policy and could change in backwards-incompatible ways.
>
>
> As you use server-side Remote Config, we encourage you to
> [share your feedback with us](https://firebase.google.com/docs/remote-config/survey).

Remote Config templates are sets of JSON-formatted parameters and
conditions created for your Firebase project. Server templates serve
configurations to server instances using the Firebase Admin SDK for
Remote Config (available for Node.js, Java, Python, and Go).

You can use the Firebase console to modify and manage your server template.
Go to **DevOps \& Engagement** \> **Remote Config** to view the contents of the
template in graphical format on the
[**Parameters** page](https://console.firebase.google.com/project/_/config/env/firebase-server)
and
[**Conditions** page](https://console.firebase.google.com/project/_/config/env/firebase-server/conditions).

Here's an example of a server template file:

```json
{
  "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-3.8-flash"
      },
      "valueType": "STRING"
    },
    "generation_config": {
      "defaultValue": {
        "value": "{\"maxOutputTokens\": 2048}"
      },
      "valueType": "JSON"
    }
  },
  "version": {
    "versionNumber": "19",
    "isLegacy": true
  }
}
```

You can perform these version management tasks in the Firebase console
(navigate to **DevOps \& Engagement** \>
[**Remote Config**](https://console.firebase.google.com/project/_/config/env/firebase-server)):

- List all stored template versions
- Retrieve a specific version
- Roll back to a specific server version
- Delete Remote Config templates from the [**Change history** page](https://console.firebase.google.com/project/_/config/env/firebase-server/history).

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](https://console.firebase.google.com/project/_/config/env/firebase-server/history)
of the Firebase console.

## Manage Remote Config template versions

This section describes how to manage versions of your Remote Config
server 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:

1. In the Firebase console, go to the
   **DevOps \& Engagement** \> **Remote Config** \>
   [**Parameters** page](https://console.firebase.google.com/project/_/config/env/firebase-server).

2. Select the "clock" icon displayed at top right.

   This opens the
   [**Change history** page](https://console.firebase.google.com/project/_/config/env/firebase-server/history)
   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:

1. In the Firebase console, go to the
   **DevOps \& Engagement** \> **Remote Config** \>
   [**Change history** page](https://console.firebase.google.com/project/_/config/env/firebase-server/history).

2. By default, the page displays the current active template. To view a
   different version, select it from the details pane on the right.

3. 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:

1. In the Firebase console, go to the
   **DevOps \& Engagement** \> **Remote Config** \>
   [**Change history** page](https://console.firebase.google.com/project/_/config/env/firebase-server/history).

2. Locate the option button at the top right of the page for previous
   template versions eligible for rollback.

3. 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:

1. In the Firebase console, go to the
   **DevOps \& Engagement** \> **Remote Config** \>
   [**Parameters** page](https://console.firebase.google.com/project/_/config/env/firebase-server).

2. Click
   [**Change history**](https://console.firebase.google.com/project/_/config/env/firebase-server/history).

3. Toggle to the template you want to delete, click
   **More**, then
   select **Delete**.

4. 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.

For example, suppose 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:

1. [Download the current Remote Config template](https://firebase.google.com/docs/remote-config/templates/server.md.txt#download-current-template).
2. [Validate the Remote Config template](https://firebase.google.com/docs/remote-config/templates/server.md.txt#validate-template).
3. [Publish the Remote Config template](https://firebase.google.com/docs/remote-config/templates/server.md.txt#publish-template).

### Download the current Remote Config template

Use the following to download the active Remote Config template in
JSON format:

1. In the Firebase console, go to the
   **DevOps \& Engagement** \> **Remote Config** \>
   [**Parameters or Conditions** page](https://console.firebase.google.com/project/_/config/env/firebase-server).

2. Open the
   **Menu**, and
   select **Download current config file**.

3. 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. Conditions that use the **User in random percentage** rule
can be imported, but any unsupported condition generates 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](https://firebase.google.com/docs/remote-config/templates/server.md.txt#rollback).

Use the following steps to publish your template:

1. In the Firebase console, go to the
   **DevOps \& Engagement** \> **Remote Config** \>
   [**Parameters or Conditions** page](https://console.firebase.google.com/project/_/config/env/firebase-server).

2. Open the
   **Menu**, and
   select **Publish from a file**.

3. When prompted, click **Browse** , navigate to and select the
   Remote Config file you want to publish, then click **Select**.

4. The file is validated. If validation succeeds, click
   **Publish** to make the configuration immediately available to your
   apps and users.

## Next steps

- Learn more about [using Remote Config in server environments](https://firebase.google.com/docs/remote-config/server.md.txt).
- Try [server-side Remote Config with Cloud Functions for Firebase and Agent Platform](https://firebase.google.com/docs/remote-config/solution-server.md.txt).