| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
The Firebase Remote Config Node.js quickstart app demonstrates retrieving and updating the Firebase Remote Config template.
This is a simple example of using the Firebase Admin SDK to update the Remote Config template being used by clients apps. You can also directly use the Remote Config REST API to perform additional template operations.
If your template already has parameters, adjust one or more of the values.
If your template is empty, update parameters and conditions to look like this:
{
"etag": "etag-<YOUR_TEMPLATE_ETAG>",
"conditions": [
{
"name": "AndroidUsers",
"expression": "device.os == 'android'",
"tagColor": "PURPLE"
},
{
"name": "iOSUsers",
"expression": "device.os == 'ios'",
"tagColor": "GREEN"
}
],
"parameters": {
"welcome_message": {
"defaultValue": {
"value": "Welcome"
},
"conditionalValues": {
"AndroidUsers": {
"value": "Welcome Android User"
},
"iOSUsers": {
"value": "Welcome iOS User"
}
}
}
}
}
From the config directory run node index.js publish to update the template.
Confirm in the console that the template has been updated.
This section provides some additional information about how the Remote Config Admin SDK should be used when retrieving and updating templates.
Each time the Remote Config template it retrieved an ETag is included. This ETag is a unique identifier of the current template on the server. When submitting updates to the template you must include the latest ETag to ensure that your updates are consistent.
In the event that you want to completely overwrite the server's template set the force parameter of publishTemplate method to true. Use this with caution since this operation cannot be undone.
| Back | FazBrowse Home | New Git URL |