Skip to content

Commit d0b704e

Browse files
authored
feat: initializeApp idempotency (#2947)
Update `initializeApp` to return an existing app if one exists with the same name and the same `AppOptions`. However, due to their inabilty to be compared, `initializeApp` will throw if an existing app has a configured `Credential` or `httpAgent`.
1 parent 26b884f commit d0b704e

File tree

8 files changed

+487
-100
lines changed

8 files changed

+487
-100
lines changed

etc/firebase-admin.app.api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ export interface FirebaseError {
8383
toJSON(): object;
8484
}
8585

86-
// @public (undocumented)
86+
// @public
8787
export function getApp(appName?: string): App;
8888

89-
// @public (undocumented)
89+
// @public
9090
export function getApps(): App[];
9191

9292
// @public
@@ -97,7 +97,7 @@ export interface GoogleOAuthAccessToken {
9797
expires_in: number;
9898
}
9999

100-
// @public (undocumented)
100+
// @public
101101
export function initializeApp(options?: AppOptions, appName?: string): App;
102102

103103
// @public

package-lock.json

Lines changed: 167 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
"@firebase/database-types": "^1.0.6",
210210
"@types/node": "^22.8.7",
211211
"farmhash-modern": "^1.1.0",
212+
"fast-deep-equal": "^3.1.1",
212213
"google-auth-library": "^9.14.2",
213214
"jsonwebtoken": "^9.0.0",
214215
"jwks-rsa": "^3.1.0",

0 commit comments

Comments
 (0)