How to use the @firebase/app.firebase.apps function in @firebase/app

To help you get started, we’ve selected a few @firebase/app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nusmodifications / nusmods / www / src / js / utils / firebase.js View on Github external
// @flow
import { firebase } from '@firebase/app';
import '@firebase/auth';
import '@firebase/firestore';

export const SYNC_COLLECTION_NAME = 'mods';

if (!firebase.apps.length) {
  firebase.initializeApp({
    // TODO: Use process.env instead
    apiKey: 'AIzaSyDyExdop0njbfcRSLbk7l3JTUsPAjS5W_8',
    authDomain: 'api-project-889500375187.firebaseapp.com',
    projectId: 'api-project-889500375187',
  });
}

export default firebase;
export const auth = firebase.auth;
export const firestore = firebase.firestore;
github hamedbaatour / angularfire-lite / src / core.service.ts View on Github external
public instance() {
    let fbApp;
    if (!firebase.apps.length) {
      fbApp = firebase.initializeApp(this.appConfig);
    } else {
      fbApp = firebase.app();
    }
    return fbApp;
  }