如果您是開發人員,並正在建構行動應用程式或行動網頁應用程式,建議您使用 Cloud Run for Firebase 函式。Firebase 可讓行動開發人員存取一系列全代管的以行動裝置為主的服務,包括分析、驗證和即時資料庫。Cloud Run 函式可透過新增伺服器端程式碼,擴充及連結 Firebase 功能的行為,進一步完善服務。
Firebase 開發人員可以整合外部服務,執行處理付款和傳送簡訊等工作。此外,開發人員也可以包含對行動裝置而言重量級過高或需要在伺服器上進行保護的自訂邏輯。請參閱這篇文章,進一步瞭解常見的整合用途。如果開發人員需要功能更完整的後端,Cloud Run 函式可提供 Google Cloud 中強大的功能。
Cloud Run for Firebase 函式專為 Firebase 開發人員最佳化:
Firebase SDK 可透過程式碼設定函式
已與 Firebase 主控台和 Firebase CLI 整合
與 Cloud Run 函式相同的觸發條件,加上 Firebase 即時資料庫、Firebase 驗證和 Firebase Analytics 觸發條件
Google Cloud的 Cloud Run 函式
開發人員可以透過以 Cloud Run 函式形式編寫程式碼,連結及擴充 Google Cloud 服務。Cloud Run 函式可做為連接層,讓您透過監聽及回應事件,在 Google Cloud 服務之間編織邏輯。開發人員只需撰寫幾行程式碼,就能充分運用 Google Cloud 服務,藉此建立更高層級的組合,而無須佈建或管理伺服器。詳情請參閱 Cloud Run 函式說明文件。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-03 (世界標準時間)。"],[[["\u003cp\u003eCloud Run functions offer a serverless compute solution for creating event-driven applications, jointly developed by Google Cloud and Firebase teams.\u003c/p\u003e\n"],["\u003cp\u003eFor Google Cloud developers, Cloud Run functions act as a connective layer to orchestrate logic between various Google Cloud services by responding to events.\u003c/p\u003e\n"],["\u003cp\u003eFirebase developers can use Cloud Run functions for Firebase to enhance Firebase features by adding server-side code and integrating with external services.\u003c/p\u003e\n"],["\u003cp\u003eBoth Cloud Run solutions offer a fully managed environment for executing functions, eliminating the need for server management or infrastructure provisioning.\u003c/p\u003e\n"],["\u003cp\u003eCloud Run functions for Firebase is specifically tailored for mobile app developers, offering Firebase SDK, console and CLI integration, and triggers for Realtime Database, Authentication, and Analytics.\u003c/p\u003e\n"]]],[],null,["# Cloud Run functions and Firebase\n================================\n\nCloud Run functions is Google's serverless compute solution for creating\nevent-driven applications. It is a joint product between the Google Cloud team\nand the Firebase team.\n\nFor **Google Cloud developers**, Cloud Run functions serve as a connective layer\nallowing you to weave logic between Google Cloud services by\nlistening for and responding to events.\n\nFor **Firebase developers** ,\n[Cloud Run functions for Firebase](https://firebase.google.com/docs/functions/)\nprovides a way to extend the behavior of Firebase and integrate Firebase\nfeatures through the addition of server-side code.\n\nBoth solutions provide fast and reliable execution of functions in a fully\nmanaged environment where there's no need for you to worry about managing any\nservers or provisioning any infrastructure.\n\nCloud Run functions for Firebase\n--------------------------------\n\nYou should use Cloud Run functions for Firebase if you're a developer building a\nmobile app or mobile web app. Firebase gives mobile developers access to a\ncomplete range of fully managed mobile-centric services including analytics,\nauthentication and Realtime Database. Cloud Run functions rounds out the offering\nby providing a way to extend and connect the behavior of Firebase features\nthrough the addition of server-side code.\n\nFirebase developers can integrate with external services for tasks like\nprocessing payments and sending SMS messages. Also, developers can include\ncustom logic that is either too heavyweight for a mobile device, or\nwhich needs to be secured on a server. See\nto learn more about typical integration use cases.\nFor developers that need a more full-featured backend, Cloud Run functions\nprovides a gateway to the powerful capabilities in\n[Google Cloud](https://cloud.google.com/docs/).\n\nCloud Run functions for Firebase is optimized for Firebase developers:\n\n- Firebase SDK to configure your functions through code\n- Integrated with Firebase Console and Firebase CLI\n- The same triggers as Cloud Run functions, plus Firebase Realtime Database, Firebase Authentication, and Firebase Analytics triggers\n\nCloud Run functions for Google Cloud\n------------------------------------\n\nDevelopers can connect and extend Google Cloud services by writing code in the form of a\nCloud Run function. Cloud Run functions serve as a connective layer allowing you to\nweave logic between Google Cloud services by listening for and responding to events. With\njust a few lines of code, developers can enrich their use of Google Cloud services to\ncreate higher level combinations without needing to provision or manage servers.\nSee the [Cloud Run functions\ndocumentation](/functions/1stgendocs) for more information."]]