现已推出具有 MongoDB 兼容性的 Firestore 企业版!
了解详情。
SDK 和客户端库
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页介绍可用于 Firebase API 的 SDK 和客户端库。虽然您可以对 Firebase API 进行直接 HTTP 和 RPC 调用,但 Firebase 客户端库可以为您实现最佳实践,并且可让您更轻松地访问数据库。
Firebase 支持移动 SDK 或 Web SDK 和服务器客户端库。
移动 SDK 和 Web SDK
Firebase 支持适用于 Android、iOS 和 Web 的 SDK。与 Firebase 安全规则和 Firebase Auth 结合使用时,移动 SDK 和 Web SDK 支持无服务器应用架构,客户端可直接连接到您的 Firebase 数据库。使用无服务器架构,您无需在客户端和 Firebase 数据库之间维护中间服务器。
移动 SDK 和 Web SDK 还支持实时更新和离线数据持久化。
如需开始使用 Android SDK、Apple 平台 SDK 或 Web SDK,请参阅
Firebase 使用入门。
参考文档和资源
如需详细了解每个 SDK,请参阅以下资源:
Web
除了标准客户端 SDK 之外,Firebase 还提供 Firestore Lite,这是一个仅限 REST 的轻量级 SDK。
服务器客户端库
Firebase 支持 C#、Go、Java、Node.js、PHP、Python 和 Ruby 语言的服务器客户端库。您可以使用这些客户端库设置特权服务器环境。
服务器客户端库会创建一个能够全面访问您数据库的特权 Firebase 环境。在此环境中,系统不会根据您的 Firebase 安全规则评估请求。特权 Firebase 服务器可以通过 Identity and Access Management (IAM) 获得保护,详情请参阅服务器客户端库的安全性。
您可以使用服务器客户端库来管理数据库任务;如果您更喜欢在您的用户与 Firebase 数据库之间使用有中间服务器的架构,也可以使用服务器客户端库。
Firebase 服务器客户端库提供 Firebase Admin SDK 和 Google Cloud 客户端库两种版本。这两组库可提供相同的 Firebase 功能。Firebase Admin SDK 在一个库中捆绑了对 Firebase 和几种其他 Firebase 产品(如 Firebase Auth 和 Firebase Cloud Messaging)的访问功能。
Firebase Admin SDK
Firebase Admin SDK 捆绑了适用于 Firebase 的 Google Cloud 客户端库和适用于几项其他 Firebase 功能的客户端库和 SDK。使用其中一个 Admin 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 或 Web SDK 和服务器客户端库之外,Firebase 还提供许多与开源库的集成。如需了解详情,请参阅库和框架集成。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-13。
[null,null,["最后更新时间 (UTC):2025-08-13。"],[],[],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)."]]