Stay organized with collections Save and categorize content based on your preferences.
Cloud Functions gives developers access to Firebase and Google Cloud events, along with scalable computing power to run code in response to those events. While it's expected that Firebase apps will use Cloud Functions in unique ways to meet their unique requirements, typical use cases might fall into these areas:
Review the use cases and examples for each category that interests you, and then proceed to our Get Started tutorial or to specific how-to guides for authentication events, analytics events, and more.
Notify users when something interesting happensDevelopers can use Cloud Functions to keep users engaged and up to date with relevant information about an app. Consider, for example, an app that allows users to follow one another's activities in the app. Each time a user adds themselves as a follower of another user, a write occurs in the Realtime Database. Then this write event could trigger a function to create Firebase Cloud Messaging (FCM) notifications to let the appropriate users know that they have gained new followers.
To review working code, see the sample code in GitHub:
With Cloud Functions database event handling, you can modify Realtime Database or Cloud Firestore in response to user behavior, keeping the system in your desired state. For example, you could monitor write events and change the format (for example, change to all uppercase) of certain strings in users' messages. Here's how that could work:
To review working code, see the sample code in GitHub:
You can take advantage of Cloud Functions to offload to the Google cloud resource-intensive work (heavy CPU or networking) instead of running it on a user's device, improving the responsiveness of your app. For instance, you could write a function to listen for image uploads to Cloud Storage, download the image to the instance running the function, modify it, and upload it back to Cloud Storage. Your modifications could include resizing, cropping, or converting images with tools like sharp or Pillow.
For a walkthrough of an image processing example, see the guide to handling Cloud Storage events.
Other examples of batch jobs in the Firebase cloudCloud Functions can help your app work better with other services by calling and exposing web APIs. For instance, an app used for collaboration on development could post GitHub commits to a workgroup chat room.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-15 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4