Cloud Functions can be triggered in response to changes in Firebase Remote Config in the same Cloud project as the function. This makes it possible to change the behavior and appearance of your app without publishing an app update.
Event types
Firebase Remote Config can trigger functions in response to the
remoteconfig.update
event.
Event Type | Trigger |
---|---|
remoteconfig.update |
Triggered when the remote config template is updated. |
Event structure
Event data is provided as a transformed remoteConfig
object.
For example:
{ "updateType": "FORCED_UPDATE", "updateOrigin": "CONSOLE", "versionNumber": 1 }
Sample code
Node.js
Python
Go
Java
C#
Deploying your function
To deploy your function, you need to specify the event type
google.firebase.remoteconfig.update
.
The following gcloud
command deploys a function that is triggered
by a Firebase Remote Config event:
gcloud functions deploy YOUR_FUNCTION_NAME \ --trigger-event google.firebase.remoteconfig.update \ --runtime RUNTIME
Argument | Description |
---|---|
--trigger-event google.firebase.remoteconfig.update |
Trigger the function upon Firebase Remote Config update events. |
--runtime RUNTIME |
The name of the runtime you are using. For a complete list, see the
gcloud reference.
|