使用firebase函数配置firebase实时数据库

使用firebase函数配置firebase实时数据库,firebase,firebase-realtime-database,google-cloud-platform,google-cloud-functions,actions-on-google,Firebase,Firebase Realtime Database,Google Cloud Platform,Google Cloud Functions,Actions On Google,我想用我的firebase云功能配置firebase实时数据库 1)what is "serviceAccountKey.json"? 2) How to get this file? 3) did one "serviceAccountKey.json" is enough for all the users using firebase functions? 假设我使用下面的示例 "exports.dbCreate = functions.database.ref('/p

我想用我的firebase云功能配置firebase实时数据库

   1)what is "serviceAccountKey.json"?
   2) How to get this file?
   3) did one "serviceAccountKey.json" is enough for all the users using firebase functions?
假设我使用下面的示例

"exports.dbCreate = functions.database.ref('/path').onCreate((event) => {
  const createdData = event.data.val(); // data that was created
   });" 
如何调用dbCreate以及在“/path”中必须给出什么路径? 如何获取serviceAccountKey.json

我使用的版本是“谷歌上的操作”:“^2.0.1”, “firebase管理员”:“~5.12.0”, “firebase函数”:“^1.0.1”, “dialogflow”:“^0.1.0”,
“dialogflow实现”:“^0.4.1”、“Firebase函数”是与Firebase项目交互的服务器端(基于云)脚本。因此,他们需要一个密钥,因为他们可以完全访问您的项目

您的示例
functions.database.ref('/path')。一旦创建
不是您调用的东西,它就会被触发

开始

与Firebase服务通信的服务帐户,以及 包含服务帐户凭据的配置文件

  • 如果您还没有Firebase项目,请在中添加一个。添加 “项目”对话框还提供了将Firebase添加到项目的选项 现有谷歌云平台项目
  • 导航到 选项卡在项目的“设置”页面中
  • 单击“服务帐户”选项卡Firebase Admin SDK部分底部的“生成新私钥”按钮