Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lemol/umi-plugin-firebase
Umi plugin for firebase
https://github.com/lemol/umi-plugin-firebase
firebase umi umi-plugin umijs
Last synced: about 4 hours ago
JSON representation
Umi plugin for firebase
- Host: GitHub
- URL: https://github.com/lemol/umi-plugin-firebase
- Owner: lemol
- License: mit
- Created: 2019-01-03T19:30:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T22:25:33.000Z (almost 2 years ago)
- Last Synced: 2024-11-08T01:37:14.216Z (9 days ago)
- Topics: firebase, umi, umi-plugin, umijs
- Language: JavaScript
- Homepage:
- Size: 486 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# umi-plugin-firebase
[![NPM version](https://img.shields.io/npm/v/umi-plugin-firebase.svg?style=flat)](https://npmjs.org/package/umi-plugin-firebase)
Umi plugin for firebase.
## Install
```bash
yarn add --dev umi-plugin-firebase # OR npm install --save-dev umi-plugin-firebase
```## Use
Just setup the plugin on `.umirc.js`
```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:
```js
import app from 'firebase/app';auth = app.auth();
```