Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase身份验证触发器的云函数_Firebase_Firebase Realtime Database_Firebase Authentication_Google Cloud Functions - Fatal编程技术网

Firebase身份验证触发器的云函数

Firebase身份验证触发器的云函数,firebase,firebase-realtime-database,firebase-authentication,google-cloud-functions,Firebase,Firebase Realtime Database,Firebase Authentication,Google Cloud Functions,我正在使用提供商Google和Facebook使用firebase身份验证进行身份验证。现在我想为firebase使用云函数。我想使用函数中的身份验证触发器将用户信息推送到数据库节点。有人能告诉我如何在身份验证触发器onCreate(event=>…)中使用firebase.ref().push()。您需要使用firebase admin const functions=require('firebase-functions'); const admin=require('firebase-ad

我正在使用提供商Google和Facebook使用firebase身份验证进行身份验证。现在我想为firebase使用云函数。我想使用函数中的身份验证触发器将用户信息推送到数据库节点。有人能告诉我如何在身份验证触发器onCreate(event=>…)中使用firebase.ref().push()。

您需要使用firebase admin

const functions=require('firebase-functions');
const admin=require('firebase-admin');
admin.initializeApp(functions.config().firebase);
返回admin.database().ref(“…”).push(
{foo:'someValue'}
);