Problem:
To initialize my functions, I used:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
Solution (for me at least):
I had to use the credentials of a Google service account:
var serviceAccount = require("./PATH_TO_YOUR_SERVICE_ACCOUNT_FILE_GOES_HERE.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://YOUR_FIREBASE_PROJECT_NAME.firebaseio.com"
});
To get the name of the firebase project, check the top left corner of the project console () A Firebase.
JSON, (B) firebase, (C) :
:
" ", .
JSON , .