Relevant repos:

Update: a recent issue discusses extending CloudEvent to parse PubSub messages:

[GoogleCloudPlatform/functions-framework-dart] Parsing pub sub messages (#239)

Before we start

Check project is set correctly (see: gcp gcloud cheat sheet)

Create a cloud function to publish

From project dir

firebase init

follow: trigger a function on user creation

follow: Manage functions deployment and runtime options > publishing_a_message_from_within_a_function

Follow Manage functions deployment and runtime options

Deploy the cloud function: firebase deploy --only functions