简体   繁体   中英

Cloud Functions for Firebase Authentication trigger

I am using provider Google and Facebook for authentication using firebase authentication. Now I wanna use Cloud Functions for 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 => ...)

You will need to use firebase-admin

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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