firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

[FR] Add a function that initializes an App or returns existing one

Open arayaryoma opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. A function initializeApp throws an error if the app is already existed at the time. As current workaround, we need to handle thrown error. (related: https://github.com/firebase/firebase-admin-node/issues/2111 )

Describe the solution you'd like Add a function wrapping initializeApp and getApp, that returns existing FirebaseApp, or initialize a new FirebaseApp if the app doesn't exist.

my sample implementation: https://github.com/arayaryoma/firebase-admin-node/commit/65be1703a0c4f8ede7fd34c63d71e05b38f48efb

Describe alternatives you've considered Not yet

Additional context If this proposal is affirmed, I can open a PullRequest.

arayaryoma avatar Sep 28 '23 16:09 arayaryoma

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Sep 28 '23 16:09 google-oss-bot