umi-plugin-fire
Umi plugin for firebase.
Install
Add to package.json
"umi-plugin-fire": "^1.0.7",
Use
Just setup the plugin on .umirc.js
or in config.js
export default {
plugins: {
// ...
firebase: {
apiKey: '',
authDomain: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
appId: '',
measurementId: '',
features: [],
},
// ...
},
};
Options
name | type |
---|---|
apiKey | string (required in production) |
authDomain | string (optional) |
databaseURL | string (optional) |
projectId | string (optional) |
storageBucket | string (optional) |
messagingSenderId | string (optional) |
features | array (optional) analytics | auth | firestore | functions | messaging | storage | performance | database | remote-config |
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';
analytics = app.analytics();