概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Firebase Extensions 可以帮助您减少在应用的开发、维护和扩展方面花费的时间。
当您找到可满足您的应用或项目需求的 Firebase Extension 扩展程序时,只需安装并配置该扩展程序即可。如果您需要扩展程序的多个配置,则可以多次安装该扩展程序,并为安装的每个实例设定不同的配置。
借助扩展程序,您无需花时间研究、编写和调试用以实现功能或自动执行应用或项目某项任务的代码。
如需安装或管理扩展程序,您必须拥有以下某个角色:Owner 或 Editor 或 Firebase Admin。
如需安装扩展程序,您的项目必须采用 Blaze(随用随付)方案。虽然扩展程序可以免费安装,但如果超出 Firebase 服务或 Cloud 服务(例如 Cloud Secret Manager)的免费层级,您可能就需要支付相应的费用。
您还可以在将扩展程序安装到项目中之前使用 Extensions 模拟器(Firebase Local Emulator Suite 的一个组件)对其进行评估。
官方 Firebase Extensions 扩展程序
官方 Firebase 扩展程序由 Firebase 和 Firebase Extensions 开发和测试。这些扩展程序安全可靠。
浏览 Firebase Extensions 扩展程序
在 Extensions Hub 中浏览 Firebase Extensions 扩展程序。
查看扩展程序的源代码
如需查找某个扩展程序的源代码链接,请在 Extensions Hub 中点击该扩展程序卡片上的了解详情。
扩展程序源代码的内容
扩展程序的源代码目录中包含:
extension.yaml 文件 - 包含扩展程序的元数据并定义所创建的资源、执行操作所需的 Google API 和访问角色,以及扩展程序的任何用户配置的参数(环境变量)
函数目录 - 包含扩展程序源代码文件
README 文件 - 列出了扩展程序的元数据(但采用更易于用户理解的格式)以及 PREINSTALL 文件中的内容
PREINSTALL 文件 - 描述扩展程序的工作方式、安装前的所有必要准备工作、配置要求以及扩展程序的相关详情
POSTINSTALL 文件 - 介绍具体的使用说明以及进一步的集成要求
扩展程序的资源
每个 Firebase 项目都包含多种类型的“资源”。项目资源可能包括已部署的 Cloud Functions 函数、数据库实例、Cloud Storage 存储桶、Cloud Scheduler 作业及 Cloud Secret Manager 数据等。
安装扩展程序时,Firebase 会在您的项目中创建新的扩展程序实例专用资源。扩展程序运行时需要这些资源。
注意,如果您卸载扩展程序实例,则 Firebase 为使该扩展程序实例运行而专门创建的所有资源(如一组函数)都会被删除。但以下各项不会被删除:
使用 Firebase 控制台、Firebase CLI 或自动生成的 SDK {: #console-vs-cli}
您可以使用 Firebase 控制台或 Firebase CLI 安装和管理扩展程序,也可以在代码中使用自动生成的 SDK 来安装和管理扩展程序。
操作 |
Firebase 控制台 |
Firebase CLI |
自动生成的 SDK |
查看详细信息(安装前) |
|
|
|
安装 |
|
|
|
查看配置(安装后) |
|
|
|
修改配置 |
|
|
|
更新版本 |
|
|
|
卸载 |
|
|
|
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-12。
[null,null,["最后更新时间 (UTC):2025-08-12。"],[],[],null,["\u003cbr /\u003e\n\nFirebase Extensions help you reduce time spent on development, maintenance,\nand growth of your app.\n\nWhen you find a Firebase Extension that solves a need for your app\nor project, all you do is install and configure the extension. If you need\nmultiple configurations of the extension, you can install the extension multiple\ntimes, with a different configuration for each instance you install.\n\nWith extensions,\nyou don't spend time researching, writing, and debugging the code that\nimplements functionality or automates a task for your app or project.\n\nTo install or manage extensions, you must be assigned one of these roles:\n[Owner or Editor](/docs/projects/iam/roles-basic) or\n[Firebase Admin](/docs/projects/iam/roles-predefined-all-products).\n\nTo install an extension, your project must be on the **Blaze** (pay as you\ngo) plan. Although there is no charge for installing an extension, you might be\ncharged for your use of Firebase services or Cloud services such as\n[Cloud Secret Manager](https://cloud.google.com/secret-manager/pricing), if your usage exceeds the services' free\ntier.\n\nYou can also evaluate extensions before installing them on a project using the\nExtensions emulator, a component of the Firebase Local Emulator Suite.\n\nOfficial Firebase extensions\n\nThe **official Firebase extensions** are developed and tested by Firebase\nand Firebase Extensions partner services. These extensions are reliable and\nsecure.\n\nBrowse Firebase extensions\n\nBrowse Firebase extensions in the [Extensions Hub](https://extensions.dev/extensions).\n\nView the source code of an extension\n\nTo find a link to the source code for an extension,\nclick **Learn more** on the extension's card in the Extensions Hub.\n\nContents of an extension's source code\n\nAn extension's source directory includes:\n\n- **extension.yaml file** --- Contains the extension's metadata and defines\n the [resources](#resources) created, the Google APIs and\n [access roles](/docs/extensions/permissions-granted-to-extension) required for\n operation, and any user-configured parameters (environment variables) for the\n extension\n\n- **functions directory** --- Contains the files for the source code for the\n extension\n\n- **README file** --- Lists the extension's metadata (but in more\n human-readable format) as well as the content from the PREINSTALL file\n\n- **PREINSTALL file** --- Describes how the extension works, any necessary\n pre-installation tasks, configuration requirements, and details about the\n extension\n\n- **POSTINSTALL file** --- Describes specific usage instructions and any further\n integration requirements\n\nResources for an extension\n\nEvery Firebase project contains several types of \"resources\". Project resources\ncan include things like deployed Cloud Functions, database instances,\nCloud Storage buckets, Cloud Scheduler jobs, and Cloud Secret Manager data.\n\nWhen you install an extension, Firebase creates new *extension-instance-specific*\nresources in your project. These resources are required by the extension to\noperate.\n\nNote that, if you [uninstall an instance of an\nextension](/docs/extensions/manage-installed-extensions#uninstall), all the\nresources that Firebase created specifically for that instance of the extension\nto operate (like a set of functions) are deleted. However, the following are\n***not*** deleted:\n\n- Any artifacts created by the extension (like stored images).\n\n- Any other resources in your project, like a database instance or Cloud Storage\n bucket. Even if the extension interacted with these other resources, they\n are not *extension-specific*, so they aren't deleted if the extension is\n uninstalled.\n\nUsing the Firebase console, the Firebase CLI, or autogenerated SDKs {: #console-vs-cli}\n\nYou can install and manage extensions using\neither the\n[Firebase console](/docs/extensions/install-extensions?platform=console)\nor the\n[Firebase CLI](/docs/extensions/install-extensions?platform=cli),\nor in code using\n[autogenerated SDKs](/docs/extensions/install-extensions?platform=sdk).\n\n| **Action** | **Firebase console** | **Firebase CLI** | **Autogenerated SDK** |\n|----------------------------------------------|----------------------|------------------|-----------------------|\n| View detailed information (pre-installation) | | | |\n| Install | | | |\n| View configuration (post-installation) | | | |\n| Edit configuration | | | |\n| Update version | | | |\n| Uninstall | | | |\n\nNext Steps\n\n- View detailed information about an extension before you install the extension\n ([Extensions Hub](https://extensions.dev/extensions) or\n [Firebase CLI](/docs/extensions/install-extensions#view-details)).\n\n- Install an extension into your Firebase project using either the\n [Firebase console](/docs/extensions/install-extensions?platform=console),\n the [Firebase CLI](/docs/extensions/install-extensions?platform=cli).\n or [autogenerated SDKs](/docs/extensions/install-extensions?platform=sdk)."]]