Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.exists(path.join(__dirname, '..', '/google_cred.json'), exists => {
if (!exists) {
return;
}
const admin = require('firebase-admin').default;
const serviceAccount = require('../google_cred.json');
const firebaseServiceAccount = serviceAccount;
if (firebaseServiceAccount.private_key) {
admin.initializeApp({
credential: admin.credential.cert(firebaseServiceAccount),
});
}
});