Umi plugin for firebase.
yarn add --dev umi-plugin-firebase # OR npm install --save-dev umi-plugin-firebase
Just setup the plugin on .umirc.js
export default {
plugins: [
// ...
['umi-plugin-firebase', {
apiKey: '',
authDomain: '',
databaseURL: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
}],
// ...
],
}
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 |
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();