How to use the @firebase/app.firebase.initializeApp 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 DanielSchaffer / webpack-babel-multi-target-plugin / examples / angular-firebase / src / app / app.component.ts View on Github external
public ngOnInit(): void {
    firebase.initializeApp({
      apiKey: 'AIzaSyA9tQLQ5WJOBS7-e9zcdGkRKjaroRI0T18',
      authDomain: 'test-59779.firebaseapp.com',
      databaseURL: 'https://test-59779.firebaseio.com',
      projectId: 'test-59779',
      storageBucket: '',
      messagingSenderId: '289255988111',
    })
    this.message = GTG
    this.renderer.setStyle(this.document.body.parentElement, 'background', 'green')

    // use e2e ready since firebase uses an interval to poll for auth updates, which breaks protractor's angular
    // ready detection
    ready()
  }
github HamishMW / portfolio-2018 / src / utils / firebase.js View on Github external
import { firebase } from '@firebase/app';
import '@firebase/database';

// Firebase config for storing messages from the contact form.
// Replace this with your own config or remove the form if you're
// checking out or modifying my protfolio – HW
import config from '../config';

const firebaseConfig = config.firebase;

export default firebase.initializeApp(firebaseConfig);
github hand-dot / taskontable / src / utils / util.js View on Github external
import UAParser from 'ua-parser-js';
import wkn from 'wkn';
import constants from '../constants';
import firebaseConf from '../configs/firebase';

const parser = new UAParser();
const browserName = parser.getBrowser().name;
const osName = parser.getOS().name;
const deviceType = parser.getDevice().type;

let database;
let auth;
let messaging;
let storage;
if (process.env.NODE_ENV !== 'test') {
  firebase.initializeApp(firebaseConf);
  database = firebase.database();
  auth = firebase.auth();
  if (constants.SUPPORTEDBROWSERS.indexOf(browserName) >= 0 && osName !== 'iOS') { // safari,iosではエラーになるため
    messaging = firebase.messaging();
  }
  storage = firebase.storage();
}

export default {
  /**
   * firebaseのdatabaseを返します。
   */
  getDatabase() {
    return database;
  },
  /**
github Sitecore / Sitecore.HabitatHome.Omni / fitness / app / src / services / SubscriptionService.js View on Github external
export const initializeFirebase = callback => {
  try {
    const senderId = process.env.REACT_APP_FIREBASE_SENDER_ID;
    if(!senderId){
      throw new Error("FIREBASE_SENDER_ID is missing. Please add it to environment variables.");
    }

    firebase.initializeApp({ messagingSenderId: senderId});
    const messagingKey = process.env.REACT_APP_FIREBASE_MESSAGING_PUSH_KEY;
    if(!messagingKey){
      throw new Error("FIREBASE_MESSAGING_PUSH_KEY is missing. Please add it to environment variables.");
    }
    const messaging = firebase.messaging();
    messaging.usePublicVapidKey(messagingKey);
    messaging.onMessage(function(payload) {
      console.log("Message received. ", payload);
      callback(payload);
    });
  } catch (err) {
    console.error("Unable to initialize firebase. " + err);
  }
};
github GDGKualaLumpur / ioxkl18 / src / components / firebase.js View on Github external
import { firebase } from '@firebase/app';
import 'firebase/auth';
import 'firebase/database';

const config = {
	apiKey: 'AIzaSyD_B8LAxG-1IlfrlZwN5HAbncuwHrCZxU8',
	authDomain: 'gdg-kl.firebaseapp.com',
	databaseURL: 'https://gdg-kl.firebaseio.com',
	projectId: 'gdg-kl',
	storageBucket: 'gdg-kl.appspot.com',
	messagingSenderId: '824291119922'
};
firebase.initializeApp(config);

export default firebase;
github popcodeorg / popcode / src / services / appFirebase.js View on Github external
import {firebase} from '@firebase/app';
import '@firebase/auth';
import '@firebase/database';
import config from '../config';

const appFirebase = firebase.initializeApp({
  apiKey: config.firebaseApiKey,
  authDomain: `${config.firebaseApp}.firebaseapp.com`,
  databaseURL: `https://${config.firebaseApp}.firebaseio.com`,
});

const auth = firebase.auth(appFirebase);
const database = firebase.database(appFirebase);
const githubAuthProvider = new firebase.auth.GithubAuthProvider();
githubAuthProvider.addScope('gist');
githubAuthProvider.addScope('public_repo');

export {auth, database, githubAuthProvider};
github MobileTribe / panda-lab / agent / src / services / services.provider.ts View on Github external
static newInstance(config: ServicesConfiguration): ServicesProvider {
        const remote = require('electron').remote as any;
        firebase.initializeApp(config);
        return remote.app.serviceProvider
    }
}
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;
  }
github MobileTribe / panda-lab / agent / src / services / repositories / firebase.repository.ts View on Github external
constructor(config: FirebaseConfig) {
        firebase.initializeApp(config);
        this.firebase = firebase
    }