File tree 5 files changed +70
-0
lines changed
snippets/firebaseapp-next/firebaseapp
5 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ // [SNIPPET_REGISTRY disabled]
2
+ // [SNIPPETS_SEPARATION enabled]
3
+
4
+ function multpleFirebaseApps ( ) {
5
+ // [START firebase_options]
6
+ const { initializeApp } = require ( "firebase/app" ) ;
7
+
8
+ // The following fields are REQUIRED:
9
+ // - Project ID
10
+ // - App ID
11
+ // - API Key
12
+ const secondaryAppConfig = {
13
+ projectId : "<PROJECT_ID>" ,
14
+ appId : "<APP_ID>" ,
15
+ apiKey : "<API_KEY>" ,
16
+ // databaseURL: "...",
17
+ // storageBucket: "...",
18
+ } ;
19
+ // [END firebase_options]
20
+
21
+ // [START firebase_secondary]
22
+ // Initialize another app with a different config
23
+ const secondaryApp = initializeApp ( secondaryAppConfig , "secondary" ) ;
24
+ // Access services, such as the Realtime Database
25
+ // getDatabase(secondaryApp)
26
+ // [END firebase_secondary]
27
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " firebaseapp-next" ,
3
+ "version" : " 1.0.0" ,
4
+ "scripts" : {
5
+ "compile" : " cp ../tsconfig.json.template ./tsconfig.json && tsc"
6
+ },
7
+ "license" : " Apache-2.0" ,
8
+ "dependencies" : {
9
+ "firebase" : " exp"
10
+ }
11
+ }
Original file line number Diff line number Diff line change 8
8
" database" ,
9
9
" database-next" ,
10
10
" firebaseapp" ,
11
+ " firebaseapp-next" ,
11
12
" firestore" ,
12
13
" firestore-next" ,
13
14
" functions" ,
Original file line number Diff line number Diff line change
1
+ // This snippet file was generated by processing the source file:
2
+ // ./firebaseapp-next/firebaseapp.js
3
+ //
4
+ // To make edits to the snippets in this file, please edit the source
5
+
6
+ // [START firebase_options_modular]
7
+ import { initializeApp } from "firebase/app" ;
8
+
9
+ // The following fields are REQUIRED:
10
+ // - Project ID
11
+ // - App ID
12
+ // - API Key
13
+ const secondaryAppConfig = {
14
+ projectId : "<PROJECT_ID>" ,
15
+ appId : "<APP_ID>" ,
16
+ apiKey : "<API_KEY>" ,
17
+ // databaseURL: "...",
18
+ // storageBucket: "...",
19
+ } ;
20
+ // [END firebase_options_modular]
Original file line number Diff line number Diff line change
1
+ // This snippet file was generated by processing the source file:
2
+ // ./firebaseapp-next/firebaseapp.js
3
+ //
4
+ // To make edits to the snippets in this file, please edit the source
5
+
6
+ // [START firebase_secondary_modular]
7
+ // Initialize another app with a different config
8
+ const secondaryApp = initializeApp ( secondaryAppConfig , "secondary" ) ;
9
+ // Access services, such as the Realtime Database
10
+ // getDatabase(secondaryApp)
11
+ // [END firebase_secondary_modular]
You can’t perform that action at this time.
0 commit comments