-1

I am new to firebase cloud messaging and i am practicing it on node js and i found that we can initialize more than one app on same project . I want to know up to how many app can we initialize in one project

2
  • What have you tried so far? Can you share your existing code where you initialise one default Admin instance? Commented Sep 8, 2022 at 8:57
  • Actually i do it by providing name to each admin instance when i call admin.initialize app and i wanna know how many app can i initialize by giving custom name . P.S the apps got initialized in runtime with dynamic name. Commented Sep 8, 2022 at 10:02

1 Answer 1

2

How to initialise multiple apps in Firebase Admin SDK

There is a specific section in the doc for this case. It shows the following code:

// Initialize the default app
initializeApp(defaultAppConfig);

// Initialize another app with a different config
var otherApp = initializeApp(otherAppConfig, 'other');

console.log(getApp().name);  // '[DEFAULT]'
console.log(otherApp.name);     // 'other'

// Use the shorthand notation to retrieve the default app's services
const defaultAuth = getAuth();
const defaultDatabase = getDatabase();

// Use the otherApp variable to retrieve the other app's services
const otherAuth = getAuth(otherApp);
const otherDatabase = getDatabase(otherApp);

I want to know up to how many app can we initialize in one project

I don’t have the answer to this question (i.e. I don’t know about any such limit) but you can initialise more than two apps.

Sign up to request clarification or add additional context in comments.

1 Comment

For #2) There is no documented limit on how many app instances you can initialize, nor is there a limit hard-coded into the SDKs or back-ends. There probably is a physical limit, but nothing is imposed by the Firebase SDKs (that I know of).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.