Firebase cloud functions let you run a specific piece of code whenever an event is triggered or an HTTP request comes to your Firebase server. This is the same as AWS's Lambda functions. Firebase cloud functions can respond to:
- Firebase Authentication triggers
- Google Analytics for Firebase triggers
- Crashlytics triggers
- Cloud Storage triggers
- Cloud Pub/Sub triggers
- HTTP triggers
Since here we are mainly discussing Kotlin, this section will demonstrate how to use Kotlin code to write a cloud function that ultimately serves as your business logic for the API.
Furthermore, in this section, we will also see how Kotlin code is transpiled into JavaScript. Well, Firebase only supports JavaScript code (or TypeScript code to transpile at deployment) to handle events from Firebase services. For this chapter, we chose to use JavaScript. We will look at how...