How to use the @firebase/app 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 flow-typed / flow-typed / definitions / npm / firebase_v5.x.x / flow_v0.104.x- / test_firebase.js View on Github external
// #1
const a1: firebase.app.App = firebase.initializeApp({
  apiKey: 'apiKey',
  databaseURL: 'databaseURL',
  projectId: '42',
})

// #2
// $ExpectError
const a2: firebase.app.App = firebase.initializeApp({
  storageBucker: 'storageBucket',
  projectId: '42',
})

// #3
const a3: app.App = app('DEFAULT')

// #4
firebase
  .auth()
  .createUserWithEmailAndPassword('email', 'password')
  .then()
  .catch()

// #5
firebase.auth().onAuthStateChanged(user => {
  if (user) {
    user.displayName
    user.email
    user.emailVerified
    user.photoURL
    user.isAnonymous