Skip to content

lemol/umi-plugin-firebase

Repository files navigation

umi-plugin-firebase

NPM version

Umi plugin for firebase.

Install

yarn add --dev umi-plugin-firebase # OR npm install --save-dev umi-plugin-firebase

Use

Just setup the plugin on .umirc.js

export default {
  plugins: [
    // ...
    ['umi-plugin-firebase', {
      apiKey: '',
      authDomain: '',
      databaseURL: '',
      projectId: '',
      storageBucket: '',
      messagingSenderId: '',
    }],
    // ...
  ],
}

Options

name type default
apiKey string (required in production) process.env.FIREBASE_API_KEY
authDomain string (optional) process.env.FIREBASE_AUTH_DOMAIN
databaseURL string (optional) process.env.FIREBASE_DATABASE_URL
projectId string (optional) process.env.FIREBASE_PROJECT_ID
storageBucket string (optional) process.env.FIREBASE_STORAGE_BUCKET
messagingSenderId string (optional) process.env.FIREBASE_MESSAGING_SENDER_ID

How to use

After you configure the plugin, you are able to use firebase app as usual. But this time you don't need to initializeApp your app:

import app from 'firebase/app';

auth = app.auth();

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •