Triggers are the mechanisms that allow a Firebase function to detect a change in the state in Firebase tools. For instance, when the Realtime Database adds a new entry, it triggers a function. Essentially, Triggers are event suppliers. In this section, we will explore the following triggers:
- Cloud Firestore Triggers
- Realtime Database Triggers
- Firebase Authentication Triggers
- Google Analytics for Firebase Triggers
- Crashlytics Triggers
- Cloud Storage Triggers
- Cloud Pub/Sub Triggers
- HTTP Triggers
Let's understand each tool in detail.
Cloud Firestore is a recent release of the Firebase toolchain. Google labels it as the flexible, scalable NoSQL. To work with Function triggers for Firestore, you don't need to write extra code on the client side. Changes to Firestore can be achieved via DeltaDocumentSnapshot
, which is an interface representing Cloud Firestore documents.
The Cloud Firestore Function typically does the following actions:
- It anticipates changes to...