⚠ Error: The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once. But if you do want to initialize multiple apps, pass a second argument to initializeApp() to give each app a unique name.
Use the following to avoid double initialization.
const admin = require('firebase-admin');
const app = !admin.apps.length ? admin.initializeApp() : admin.app();