现已推出具有 MongoDB 兼容性的 Firestore 企业版!
了解详情。
SDK 和用戶端程式庫
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本頁面說明適用於 Firebase API 的 SDK 和用戶端程式庫。您可以直接對 Firebase API 發出 HTTP 和 RPC 呼叫,但 Firebase 用戶端程式庫會為您實作最佳做法,方便您存取資料庫。
Firebase 支援行動或網頁 SDK 和伺服器用戶端程式庫。
行動和網頁 SDK
Firebase 支援 Android、iOS 和網頁版 SDK。搭配Firebase安全性規則和 Firebase Auth,行動和網頁 SDK 支援無伺服器應用程式架構,讓用戶端直接連線至 Firebase 資料庫。採用無伺服器架構後,您不需要在用戶端和 Firebase 資料庫之間維護中繼伺服器。
行動和網頁 SDK 也支援即時更新和永久保存離線資料。
如要開始使用 Android、Apple 平台或 Web SDK,請參閱「
開始使用 Firebase」。
參考資料和資源
如要進一步瞭解各個 SDK,請參閱下列資源:
網頁
除了標準用戶端 SDK,Firebase 也提供 Firestore Lite,這款 SDK 僅支援 REST,且輕量化。
伺服器用戶端程式庫
Firebase 支援 C#、Go、Java、Node.js、PHP、Python 和 Ruby 的伺服器用戶端程式庫。使用這些用戶端程式庫設定具備特殊權限的伺服器環境。
伺服器用戶端程式庫會建立具備完整資料庫存取權的 Firebase 環境。在這個環境中,系統不會根據 Firebase 安全性規則評估要求。系統會使用身分與存取權管理 (IAM) 保護具備特殊權限的Firebase伺服器,詳情請參閱「伺服器用戶端程式庫的安全性」。
如要執行管理資料庫工作,或是偏好在使用者和 Firebase 資料庫之間使用中介伺服器的架構,請使用伺服器用戶端程式庫。
Firebase 伺服器用戶端程式庫可做為 Firebase Admin SDK 和 Google Cloud 用戶端程式庫。這兩組程式庫都提供相同的 Firebase 功能。Firebase Admin SDK 會將 Firebase 和其他多項 Firebase 產品 (例如 Firebase Authentication 和 Firebase Cloud Messaging) 的存取權,整合到單一程式庫中。
Firebase Admin SDK
Firebase Admin SDK 會將 Firebase 的 Google Cloud 用戶端程式庫,與其他多項 Firebase 功能的用戶端程式庫和 SDK 組合在一起。使用其中一個 Admin SDK,您就能從單一 SDK 初始化對 Firebase 和其他多項服務的存取權。Firebase Admin SDK 支援以 Java、Python、Node.js 和 Go 存取 Firebase。
如要開始使用 Firebase Admin SDK,請參閱「將 Firebase Admin SDK 新增至伺服器」。
參考資料和資源
如要進一步瞭解 Firebase Admin SDK,請參閱下列資源:
Google Cloud 用戶端程式庫
Google Cloud 用戶端程式庫支援 Java、Python、Node.js、Go、PHP、C# 和 Ruby 的 Firebase 存取權。如要開始使用其中一個 Google Cloud 用戶端程式庫,請參閱使用伺服器用戶端程式庫的快速入門導覽課程。
參考資料和資源
如要進一步瞭解 Firebase 適用的 Google Cloud 用戶端程式庫,請參閱下列資源:
整合第三方程式庫
除了行動或網頁 SDK 和伺服器用戶端程式庫,Firebase 也提供多種開放原始碼程式庫的整合功能。詳情請參閱「程式庫和架構整合」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nThis page describes the SDKs and client libraries available for the\nFirebase API. While you can make direct HTTP and RPC calls to the\nFirebase API, the Firebase client libraries\nimplement best practices for you and make it easier to access your database.\n\nFirebase supports mobile or web SDKs and server client\nlibraries.\n\nMobile and web SDKs\n\nFirebase supports SDKs for Android, iOS, and web. Combined with\n[Firebase security rules](https://cloud.google.com/firestore/docs/security/get-started)\nand [Firebase Auth](https://firebase.google.com/docs/auth/), the\nmobile and web SDKs support serverless app architectures where clients connect\ndirectly to your Firebase database. With a serverless\narchitecture, you don't need to maintain an intermediary server between your\nclients and your Firebase database.\n\nThe mobile and web SDKs also support\n[realtime updates](https://cloud.google.com/firestore/docs/query-data/listen)\nand [offline data persistence](https://firebase.google.com/docs/firestore/manage-data/enable-offline).\nTo get started with the Android, Apple platforms, or Web SDK, see [Get started with Firebase](/docs/firestore/quickstart).\n\nReferences and resources\n\nFor more information about each SDK, see the following resources: \n\nWeb\n\n- [API Reference Documentation](https://firebase.google.com/docs/reference/js/firebase.firestore)\n- [Source Code](https://github.com/firebase/firebase-js-sdk/tree/master/packages/firestore)\n- [GitHub Issue Tracker](https://github.com/firebase/firebase-js-sdk/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+javascript)\n\n\nIn addition to the standard client SDK, Firebase offers Firestore Lite, a\nlightweight, REST-only SDK.\n\n- [Firestore Lite Solutions Guide](https://firebase.google.com/docs/firestore/solutions/firestore-lite)\n- [Firestore Lite API Reference Documentation](https://firebase.google.com/docs/reference/js/firestore_lite.md)\n- [Firestore Lite Source Code](https://github.com/firebase/firebase-js-sdk/tree/master/packages/firestore/lite)\n- [Firestore Lite GitHub Issue Tracker](https://github.com/firebase/firebase-js-sdk/labels/api%3A%20firestore)\n\niOS+\n\n- [API Reference Documentation](https://firebase.google.com/docs/reference/swift/firebasefirestore/api/reference/Classes)\n- [Source Code](https://github.com/firebase/firebase-ios-sdk/tree/master/Firestore)\n- [GitHub Issue Tracker](https://github.com/firebase/firebase-ios-sdk/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+ios)\n\nAndroid\n\n- [API Reference Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/package-summary)\n- [Source Code](https://github.com/firebase/firebase-android-sdk/tree/master/firebase-firestore)\n- [GitHub Issue Tracker](https://github.com/firebase/firebase-android-sdk/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+android)\n\nFlutter\n\n- [API Reference Documentation](https://pub.dev/documentation/cloud_firestore/latest/)\n- [Source Code](https://github.com/firebase/flutterfire/)\n- [GitHub Issue Tracker](https://github.com/firebase/flutterfire/issues)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+flutter)\n\nServer client libraries\n\nFirebase supports server client libraries for C#, Go, Java,\nNode.js, PHP, Python, and Ruby. Use these client libraries to set up\nprivileged server environments.\n\nServer client libraries create a privileged Firebase environment\nwith full access to your database. In this environment, requests are not\nevaluated against your Firebase security rules. Privileged\nFirebase servers are secured using Identity and Access Management\n(IAM), see [Security for server client libraries](../security/iam).\n\nUse the server client libraries for administrative database tasks or\nif you prefer an architecture with an intermediary server between your users and\nyour Firebase database.\n\nFirebase server client libraries are available as [Firebase Admin\nSDKs](https://firebase.google.com/docs/admin/setup) and as Google Cloud\nclient libraries. Both sets of libraries\nprovide the same Firebase features. The Firebase Admin SDKs bundle\naccess to Firebase and several other Firebase products, like\nFirebase Auth and Firebase Cloud Messaging, in a single library.\n\nFirebase Admin SDKs\n\nThe [Firebase Admin SDKs](https://firebase.google.com/docs/admin/setup) bundle\nthe Google Cloud client libraries for Firebase alongside client\nlibraries and SDKs for several other Firebase features. Using one of the Admin\nSDKs, you can initialize access to Firebase and several other\nservices from a single SDK. The Firebase Admin SDKs support\nFirebase access in Java, Python, Node.js, and Go.\n\nTo get started with a Firebase Admin SDK, see\n[Add the Firebase Admin SDK to Your Server](https://firebase.google.com/docs/admin/setup).\n\nReferences and resources\n\nFor more information about Firebase Admin SDKs, see the following resources: \n\nJava\n\n- [API Reference Documentation](https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/package-summary)\n- [Source Code](https://github.com/firebase/firebase-admin-java)\n- [GitHub Issue Tracker](https://github.com/firebase/firebase-admin-java/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/firebase-admin+java)\n\nPython\n\n- [API Reference Documentation](https://firebase.google.com/docs/reference/admin/python/)\n- [Source Code](https://github.com/firebase/firebase-admin-python)\n- [GitHub Issue Tracker](https://github.com/firebase/firebase-admin-python/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/firebase-admin+python)\n\nNode.js\n\n- [API Reference Documentation](https://firebase.google.com/docs/reference/admin/node/)\n- [Source Code](https://github.com/firebase/firebase-admin-node)\n- [GitHub Issue Tracker](https://github.com/firebase/firebase-admin-node/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/node.js+firebase-admin)\n\nGo\n\n- [API Reference Documentation](https://godoc.org/firebase.google.com/go)\n- [Source Code](https://github.com/firebase/firebase-admin-go)\n- [GitHub Issue Tracker](https://github.com/firebase/firebase-admin-go/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/firebase-admin+go)\n\nGoogle Cloud client libraries\n\nThe Google Cloud client libraries support Firebase access in\nJava, Python, Node.js, Go, PHP, C#, and Ruby. To get started with one of the\nGoogle Cloud client libraries, see the\n[Quickstart using a Server Client Library](https://cloud.google.com/firestore/docs/quickstart-servers).\n\nReferences and resources\n\nFor more information about Google Cloud client libraries for Firebase,\nsee the following resources: \n\nJava\n\n- [API Reference Documentation](https://cloud.google.com/java/docs/reference/google-cloud-firestore/latest/overview.html)\n- [Source Code](https://github.com/googleapis/java-firestore)\n- [GitHub Issue Tracker](https://github.com/googleapis/java-firestore/issues)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+java)\n\nPython\n\n- [API Reference Documentation](https://cloud.google.com/python/docs/reference/firestore/latest/index.html)\n- [Source Code](https://github.com/googleapis/python-firestore)\n- [GitHub Issue Tracker](https://github.com/googleapis/python-firestore/issues)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+python)\n\nNode.js\n\n- [API Reference Documentation](https://googleapis.dev/nodejs/firestore/latest/)\n- [Source Code](https://github.com/googleapis/nodejs-firestore/)\n- [GitHub Issue Tracker](https://github.com/googleapis/nodejs-firestore/issues)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/node.js+google-cloud-firestore)\n\nGo\n\n- [API Reference Documentation](https://godoc.org/cloud.google.com/go/firestore)\n- [Source Code](https://github.com/googleapis/google-cloud-go/tree/master/firestore)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-go/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+go)\n\nPHP\n\n- [API Reference Documentation](https://googleapis.github.io/google-cloud-php/#/docs/cloud-firestore/latest)\n- [Source Code](https://github.com/googleapis/google-cloud-php/tree/master/Firestore)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-php/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+php)\n\nC#\n\n- [API Reference Documentation](https://googleapis.github.io/google-cloud-dotnet/docs/Google.Cloud.Firestore/)\n- [Source Code](https://github.com/googleapis/google-cloud-dotnet)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-dotnet/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+c%23)\n\nRuby\n\n- [API Reference Documentation](https://googleapis.dev/ruby/google-cloud-firestore/latest)\n- [Source Code](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-firestore)\n- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-ruby/labels/api%3A%20firestore)\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+ruby)\n\nThird-party library integrations\n\nIn addition to the mobile or web SDKs and server client libraries,\nFirebase offers a number of integrations with open-source\nlibraries. For more information, see [Library and framework\nintegrations](https://firebase.google.com/docs/firestore/library-integrations)."]]