Is it possible to trigger a Google Cloud Function from a Firestore Event with the Serverless Framework?
I’m using Google Cloud Functions + Serverless Framework and I am trying to figure out if the Serverless Framework supports firestore-events.
I want to use Cloud Firestore triggers, but unsure if it’s support, and if it is, then how I correctly specify the event in the serverless.yml file?
An example of a function that should trigger event when any changes to a document happens. From here: https://firebase.google.com/docs/functions/firestore-events
Note: I am importing functions from firebase in a separate file and then importing it in my index.js.
exports.firestoreEvents = functions.firestore
.document(‘users/marie’).onWrite((change, context) => {
// ... Your code here
});
If supported, how do I configure it in serverless.yml?
firestoreEvents:
handler: firestoreEvents
events:
- event:
????