简体   繁体   English

Firebase身份验证触发器的云功能

[英]Cloud Functions for Firebase Authentication trigger

I am using provider Google and Facebook for authentication using firebase authentication. 我正在使用提供商Google和Facebook进行使用Firebase身份验证的身份验证。 Now I wanna use Cloud Functions for firebase. 现在,我想将Cloud Functions用于Firebase。 I want to push the users information using authentication trigger in functions to database node. 我想使用功能中的身份验证触发器将用户信息推送到数据库节点。 Can some one tell me how to use firebase.ref().push() in authentication trigger onCreate(event => ...) 有人可以告诉我如何在身份验证触发器onCreate(event => ...)中使用firebase.ref()。push()

You will need to use firebase-admin 您将需要使用firebase-admin

const functions = require('firebase-functions');
const admin = require('firebase-admin');

admin.initializeApp(functions.config().firebase);

return admin.database().ref('...').push(
    {foo: 'someValue'}
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM