Skip to content

Commit f43d0c6

Browse files
authored
change the instantion mode to explicit for appcheck (#5097)
1 parent 6ad4f58 commit f43d0c6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

packages-exp/app-check-exp/src/index.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
* limitations under the License.
1616
*/
1717
import { registerVersion, _registerComponent } from '@firebase/app-exp';
18-
import { Component, ComponentType } from '@firebase/component';
18+
import {
19+
Component,
20+
ComponentType,
21+
InstantiationMode
22+
} from '@firebase/component';
1923
import { _AppCheckComponentName } from './public-types';
2024
import { factory, internalFactory } from './factory';
2125
import { initializeDebugMode } from './debug';
@@ -44,6 +48,16 @@ function registerAppCheck(): void {
4448
},
4549
ComponentType.PUBLIC
4650
)
51+
.setInstantiationMode(InstantiationMode.EXPLICIT)
52+
/**
53+
* Initialize app-check-internal after app-check is initialized to make AppCheck available to
54+
* other Firebase SDKs
55+
*/
56+
.setInstanceCreatedCallback(
57+
(container, _identifier, _appcheckService) => {
58+
container.getProvider(APP_CHECK_NAME_INTERNAL).initialize();
59+
}
60+
)
4761
);
4862

4963
// The internal interface used by other Firebase products
@@ -55,7 +69,7 @@ function registerAppCheck(): void {
5569
return internalFactory(appCheck);
5670
},
5771
ComponentType.PUBLIC
58-
)
72+
).setInstantiationMode(InstantiationMode.EXPLICIT)
5973
);
6074

6175
registerVersion(name, version);

0 commit comments

Comments
 (0)