How to use the initializeApp function from firebase-admin

Find comprehensive JavaScript firebase-admin.initializeApp code examples handpicked from public code repositorys.

44
45
46
47
48
49
50
51
52
53
54
55


console.log(`UDMI version ${UDMI_VERSION}, functions ${FUNCTIONS_VERSION_MIN}:${FUNCTIONS_VERSION_MAX}`);
console.log(`Deployed by ${version.deployed_by} at ${version.deployed_at}`);


if (useFirestore) {
  admin.initializeApp(functions.config().firebase);
} else {
  console.log('No FIREBASE_CONFIG defined');
}
const firestore = useFirestore ? admin.firestore() : null;
fork icon33
star icon33
watch icon10

+ 4 other calls in file

24
25
26
27
28
29
30
31
32
33
34
  database: "mams_siso",
  port: "3306"
});


try {
  admin.initializeApp({
    apiKey: process.env.apiKey,
    authDomain: process.env.authDomain,
    projectId: process.env.projectId,
    storageBucket: process.env.storageBucket,
fork icon0
star icon0
watch icon1

+ 4 other calls in file

13
14
15
16
17
18
19
20
21
22
23
24
  measurementId: process.env.LOT_API_FIREBASE_MEASUREMENT_ID,
  credential: admin.credential.cert(credentials),
};


// Initialize Firebase app
const app = admin.initializeApp(firebaseConfig);


// Initialize Firestore database and storage bucket
const db = admin.firestore();
const bucket = getStorage().bucket();
fork icon0
star icon0
watch icon1

+ 9 other calls in file

14
15
16
17
18
19
20
21
22
23
24
const msiKeys = require('../msiKeys.json');
const serviceAccount = require('../brainswipes-firebase-adminsdk.json');


//init the firebase connection
var admin = require("firebase-admin");
const firebaseApp = admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://brainswipes-default-rtdb.firebaseio.com"
});
const database = admin.database();
fork icon0
star icon0
watch icon1