I\'m trying to use a Firebase Cloud Function to update a document within my Firestore database, when one of my documents has been updated using a trigger. The trigger is cal
My solution was setting up the serviceAccount, check the following code snippet:
var admin = require("firebase-admin");
var serviceAccount = require("path/to/serviceAccountKey.json");
admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://your-database-url.firebaseio.com"
});
You can generate the serviceAccountKey on: Firebase dashboard -> Project Settings -> Service Accounts tab
Hope it helps!