0

I have a parent Firebase project that controls access to other Firebase projects. The parent project initializes whichever child project it needs to in order to create users, add docs to db, etc within the child project. It seems like, with the same service account credentials I should be able to initialize getFunctions and access a function in a specific child project. This was alluded to in another question as the solution they didn't want, so I would imagine its possible but can't get it to work. This is what I have for the parent project side:

import { getFunctions } from 'firebase-admin/functions';

async parentFn () {
  app.child = initializeApp({
    credential: cert(serviceAccount.apps.child),
  });
  const functions = {child: getFunctions(app.child)};
  
  const childFnRes = await functions[child].childFunction(param);
}

Is there a way to declare the childFunction in the child project so that it is accessible?

  • You can refer this [document](https://firebase.google.com/docs/admin/setup#initialize-multiple-apps) to read data from the Realtime Database of one Firebase project and mint custom tokens for another project. – Sathi Aiswarya Jul 14 '23 at 07:09

0 Answers0