If you are creating a new function, see the Console Quickstart on Cloud Run. The content on this page only applies to existing legacy functions created with the Cloud Functions v1 API.
Stay organized with collections
Save and categorize content based on your preferences.
Firebase Remote Config Triggers
Cloud Run functions can be triggered in response to changes in
Firebase Remote Config in the
same Google 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.
/** * Background Function triggered by a change to a Firebase Remote Config value. * * @param {object} event The Cloud Functions event. */exports.helloRemoteConfig=event=>{console.log(`Update type: ${event.updateType}`);console.log(`Origin: ${event.updateOrigin}`);console.log(`Version: ${event.versionNumber}`);};
Python
defhello_remote_config(data,context):"""Triggered by a change to a Firebase Remote Config value. Args: data (dict): The event payload. context (google.cloud.functions.Context): Metadata for the event. """print(f'Update type: {data["updateType"]}')print(f'Origin: {data["updateOrigin"]}')print(f'Version: {data["versionNumber"]}')
Go
// Package helloworld provides a set of Cloud Functions samples.packagehelloworldimport("context""log")// A RemoteConfigEvent is an event triggered by Firebase Remote Config.typeRemoteConfigEventstruct{UpdateOriginstring`json:"updateOrigin"`UpdateTypestring`json:"updateType"`UpdateUserstruct{Emailstring`json:"email"`ImageURLstring`json:"imageUrl"`Namestring`json:"name"`}`json:"updateUser"`VersionNumberstring`json:"versionNumber"`}// HelloRemoteConfig handles Firebase Remote Config events.funcHelloRemoteConfig(ctxcontext.Context,eRemoteConfigEvent)error{log.Printf("Update type: %v",e.UpdateType)log.Printf("Origin: %v",e.UpdateOrigin)log.Printf("Version: %v",e.VersionNumber)returnnil}
Java
importcom.google.cloud.functions.Context;importcom.google.cloud.functions.RawBackgroundFunction;importcom.google.gson.Gson;importcom.google.gson.JsonObject;importjava.util.logging.Logger;publicclassFirebaseRemoteConfigimplementsRawBackgroundFunction{privatestaticfinalLoggerlogger=Logger.getLogger(FirebaseRemoteConfig.class.getName());// Use GSON (https://github.com/google/gson) to parse JSON content.privatestaticfinalGsongson=newGson();@Overridepublicvoidaccept(Stringjson,Contextcontext){JsonObjectbody=gson.fromJson(json,JsonObject.class);if(body!=null){if(body.has("updateType")){logger.info("Update type: "+body.get("updateType").getAsString());}if(body.has("updateOrigin")){logger.info("Origin: "+body.get("updateOrigin").getAsString());}if(body.has("versionNumber")){logger.info("Version: "+body.get("versionNumber").getAsString());}}}}
C#
usingCloudNative.CloudEvents;usingGoogle.Cloud.Functions.Framework;usingGoogle.Events.Protobuf.Firebase.RemoteConfig.V1;usingMicrosoft.Extensions.Logging;usingSystem.Threading;usingSystem.Threading.Tasks;namespaceFirebaseRemoteConfig;publicclassFunction:ICloudEventFunction<RemoteConfigEventData>{privatereadonlyILogger_logger;publicFunction(ILogger<Function>logger)=>
_logger=logger;publicTaskHandleAsync(CloudEventcloudEvent,RemoteConfigEventDatadata,CancellationTokencancellationToken){_logger.LogInformation("Update type: {origin}",data.UpdateType);_logger.LogInformation("Update origin: {origin}",data.UpdateOrigin);_logger.LogInformation("Version number: {version}",data.VersionNumber);// In this example, we don't need to perform any asynchronous operations, so the// method doesn't need to be declared async.returnTask.CompletedTask;}}
Ruby
require"functions_framework"# Triggered by a change to a Firebase Remote Config valueFunctionsFramework.cloud_event"hello_remote_config"do|event|# Event-triggered Ruby functions receive a CloudEvents::Event::V1 object.# See https://cloudevents.github.io/sdk-ruby/latest/CloudEvents/Event/V1.html# The Firebase event payload can be obtained from the event data.payload=event.datalogger.info"Update type: #{payload['updateType']}"logger.info"Origin: #{payload['updateOrigin']}"logger.info"Version: #{payload['versionNumber']}"end
The registered name of the Cloud Run function you are deploying.
This can either be the name of a function in your
source code, or an arbitrary string. If FUNCTION_NAME is an
arbitrary string, then you must include the
--entry-point flag.
--entry-point ENTRY_POINT
The name of a function or class in your source code. Optional, unless
you did not use FUNCTION_NAME
to specify the
function in your source code to be executed during deployment. In that
case, you must use --entry-point to supply the name of the
executable function.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eFirebase Remote Config triggers allow Cloud Run functions to respond to changes in Firebase Remote Config, enabling dynamic app behavior and appearance updates without app store releases.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eremoteconfig.update\u003c/code\u003e event type triggers functions whenever the Remote Config template is updated, providing real-time adaptability.\u003c/p\u003e\n"],["\u003cp\u003eEvent data for Remote Config updates includes \u003ccode\u003eupdateType\u003c/code\u003e, \u003ccode\u003eupdateOrigin\u003c/code\u003e, and \u003ccode\u003eversionNumber\u003c/code\u003e, offering detailed information about the configuration change.\u003c/p\u003e\n"],["\u003cp\u003eBeta triggers for Remote Config may have evolving formats for CloudEvents, particularly in the \u003ccode\u003eSource\u003c/code\u003e, \u003ccode\u003eSubject\u003c/code\u003e, and data payload, so adaptations may be needed.\u003c/p\u003e\n"],["\u003cp\u003eDeploying functions with Firebase Remote Config triggers requires specifying \u003ccode\u003egoogle.firebase.remoteconfig.update\u003c/code\u003e as the trigger event, alongside the function name, entry point, and runtime environment.\u003c/p\u003e\n"]]],[],null,["# Firebase Remote Config Triggers\n===============================\n\n|\n| **Beta**\n|\n|\n| This feature is covered by the\n| [Pre-GA Offerings Terms](/terms/service-terms#1) of the Google Cloud\n| Terms of Service. Pre-GA features may have limited support, and changes\n| to pre-GA features may not be compatible with other pre-GA versions.\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n|\n|\n| Specifically, note that\n| [CloudEvents](/functions/1stgendocs/writing/write-event-driven-functions) that are\n| generated by Beta triggers may change format over time. The `Source`\n| and `Subject` attributes, additional extension attributes, and the\n| data (payload) format are all subject to change.\n\nCloud Run functions can be triggered in response to changes in\n[Firebase Remote Config](https://firebase.google.com/docs/remote-config) in the\nsame Google Cloud project as the function. This makes it possible to change\nthe behavior and appearance of your app without publishing an app update.\n\nEvent types\n-----------\n\nFirebase Remote Config can trigger functions in response to the\n`remoteconfig.update` event.\n\nEvent structure\n---------------\n\nEvent data is provided as a transformed [`remoteConfig` object](https://firebase.google.com/docs/reference/remote-config/rest/v1/RemoteConfig).\n\nFor example: \n\n```bash\n{\n \"updateType\": \"FORCED_UPDATE\",\n \"updateOrigin\": \"CONSOLE\",\n \"versionNumber\": 1\n}\n```\n\nSample code\n-----------\n\n### Node.js\n\n /**\n * Background Function triggered by a change to a Firebase Remote Config value.\n *\n * @param {object} event The Cloud Functions event.\n */\n exports.helloRemoteConfig = event =\u003e {\n console.log(`Update type: ${event.updateType}`);\n console.log(`Origin: ${event.updateOrigin}`);\n console.log(`Version: ${event.versionNumber}`);\n };\n\n### Python\n\n def hello_remote_config(data, context):\n \"\"\"Triggered by a change to a Firebase Remote Config value.\n Args:\n data (dict): The event payload.\n context (google.cloud.functions.Context): Metadata for the event.\n \"\"\"\n print(f'Update type: {data[\"updateType\"]}')\n print(f'Origin: {data[\"updateOrigin\"]}')\n print(f'Version: {data[\"versionNumber\"]}')\n\n### Go\n\n\n // Package helloworld provides a set of Cloud Functions samples.\n package helloworld\n\n import (\n \t\"context\"\n \t\"log\"\n )\n\n // A RemoteConfigEvent is an event triggered by Firebase Remote Config.\n type RemoteConfigEvent struct {\n \tUpdateOrigin string `json:\"updateOrigin\"`\n \tUpdateType string `json:\"updateType\"`\n \tUpdateUser struct {\n \t\tEmail string `json:\"email\"`\n \t\tImageURL string `json:\"imageUrl\"`\n \t\tName string `json:\"name\"`\n \t} `json:\"updateUser\"`\n \tVersionNumber string `json:\"versionNumber\"`\n }\n\n // HelloRemoteConfig handles Firebase Remote Config events.\n func HelloRemoteConfig(ctx context.Context, e RemoteConfigEvent) error {\n \tlog.Printf(\"Update type: %v\", e.UpdateType)\n \tlog.Printf(\"Origin: %v\", e.UpdateOrigin)\n \tlog.Printf(\"Version: %v\", e.VersionNumber)\n \treturn nil\n }\n\n### Java\n\n import com.google.cloud.functions.Context;\n import com.google.cloud.functions.RawBackgroundFunction;\n import com.google.gson.Gson;\n import com.google.gson.JsonObject;\n import java.util.logging.Logger;\n\n public class FirebaseRemoteConfig implements RawBackgroundFunction {\n private static final Logger logger = Logger.getLogger(FirebaseRemoteConfig.class.getName());\n\n // Use GSON (https://github.com/google/gson) to parse JSON content.\n private static final Gson gson = new Gson();\n\n @Override\n public void accept(String json, Context context) {\n JsonObject body = gson.fromJson(json, JsonObject.class);\n\n if (body != null) {\n if (body.has(\"updateType\")) {\n logger.info(\"Update type: \" + body.get(\"updateType\").getAsString());\n }\n if (body.has(\"updateOrigin\")) {\n logger.info(\"Origin: \" + body.get(\"updateOrigin\").getAsString());\n }\n if (body.has(\"versionNumber\")) {\n logger.info(\"Version: \" + body.get(\"versionNumber\").getAsString());\n }\n }\n }\n }\n\n### C#\n\n```c#\nusing CloudNative.CloudEvents;\nusing Google.Cloud.Functions.Framework;\nusing Google.Events.Protobuf.Firebase.RemoteConfig.V1;\nusing Microsoft.Extensions.Logging;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace FirebaseRemoteConfig;\n\npublic class Function : ICloudEventFunction\u003cRemoteConfigEventData\u003e\n{\n private readonly ILogger _logger;\n\n public Function(ILogger\u003cFunction\u003e logger) =\u003e\n _logger = logger;\n\n public Task HandleAsync(CloudEvent cloudEvent, RemoteConfigEventData data, CancellationToken cancellationToken)\n {\n _logger.LogInformation(\"Update type: {origin}\", data.UpdateType);\n _logger.LogInformation(\"Update origin: {origin}\", data.UpdateOrigin);\n _logger.LogInformation(\"Version number: {version}\", data.VersionNumber);\n\n // In this example, we don't need to perform any asynchronous operations, so the\n // method doesn't need to be declared async.\n return Task.CompletedTask;\n }\n}\n```\n\n### Ruby\n\n require \"functions_framework\"\n\n # Triggered by a change to a Firebase Remote Config value\n FunctionsFramework.cloud_event \"hello_remote_config\" do |event|\n # Event-triggered Ruby functions receive a CloudEvents::Event::V1 object.\n # See https://cloudevents.github.io/sdk-ruby/latest/CloudEvents/Event/V1.html\n # The Firebase event payload can be obtained from the event data.\n payload = event.data\n\n logger.info \"Update type: #{payload['updateType']}\"\n logger.info \"Origin: #{payload['updateOrigin']}\"\n logger.info \"Version: #{payload['versionNumber']}\"\n end\n\n### PHP\n\n```php\nuse Google\\CloudFunctions\\CloudEvent;\n\nfunction firebaseRemoteConfig(CloudEvent $cloudevent)\n{\n $log = fopen(getenv('LOGGER_OUTPUT') ?: 'php://stderr', 'wb');\n\n $data = $cloudevent-\u003egetData();\n\n fwrite($log, 'Update type: ' . $data['updateType'] . PHP_EOL);\n fwrite($log, 'Origin: ' . $data['updateOrigin'] . PHP_EOL);\n fwrite($log, 'Version: ' . $data['versionNumber'] . PHP_EOL);\n}\n```\n\n### Deploying your function\n\nTo deploy your function, you need to specify the event type\n`google.firebase.remoteconfig.update`.\n\nThe following `gcloud` command deploys a function that is triggered\nby a Firebase Remote Config event: \n\n```bash\ngcloud functions deploy FUNCTION_NAME \\\n --no-gen2 \\\n --entry-point ENTRY_POINT \\\n --trigger-event google.firebase.remoteconfig.update \\\n --runtime RUNTIME\n```\n| **Note:** When you deploy a function using the Google Cloud CLI, the command must include the name of the function contained in your code that you want the `deploy` command to execute. You can specify that function using either `FUNCTION_NAME` or the optional `--entry-point` flag, depending on the needs of your implementation. See the [deployment guide](/functions/1stgendocs/deploy#basics) for more discussion."]]