Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/resulturan/refine-firebase
https://github.com/resulturan/refine-firebase
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/resulturan/refine-firebase
- Owner: resulturan
- License: mit
- Created: 2021-10-28T18:44:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T15:07:11.000Z (9 months ago)
- Last Synced: 2024-10-20T22:03:38.296Z (2 months ago)
- Language: TypeScript
- Size: 103 KB
- Stars: 42
- Watchers: 2
- Forks: 22
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-refine - refine-firebase
README
![npm](https://img.shields.io/npm/v/refine-firebase)
![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/refine-firebase/1.1.1)
![npm](https://img.shields.io/npm/dt/refine-firebase)
![GitHub](https://img.shields.io/github/license/resulturan/refine-firebase)
![GitHub Repo stars](https://img.shields.io/github/stars/resulturan/refine-firebase?style=social)# Refine-Firebase
> Firebase integration tool for your Refine app
## Install
```bash
npm i refine-firebase
```## Usage
**1. Create a config file and initialize firebase.**
_firebaseConfig.js_
```js
import { initializeFirebase } from "refine-firebase";export const firebaseConfig = {
apiKey: XXXXX,
authDomain: XXXXX,
projectId: XXXXX,
storageBucket: XXXXX,
messagingSenderId: XXXXX,
appId: XXXXX,
databaseURL: XXXXX,
};export const firebaseApp = initializeFirebase(firebaseConfig);
```**2. Create tools according to your needs.**
_firebaseConfig.js_
```js
import {
FirebaseAuth,
FirebaseDatabase,
FirestoreDatabase,
} from "refine-firebase";export const firebaseAuth = new FirebaseAuth();
export const firestoreDatabase = new FirestoreDatabase();
export const firebaseDatabase = new FirebaseDatabase();
```**3. Use dataProviders for Refine**
_App.js_
```js
import {firebaseAuth, firestoreDatabase }from "./firebaseConfig";
```## API Reference
### **Functions**
| Function | Description |
| ------------------ | ----------------------------------------------- |
| initializeFirebase | Creates and initializes a FirebaseApp instance. |### **Classes**
| Class | Description |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| FirebaseAuth | Provider for generating [firebase-authentication] and [IAuthContext] for @pankod/refine auth-provider |
| FirestoreDatabase | Provider for initializing [Firestore] instance with the provided FirebaseApp and creating @pankod/refine [dataProvider] |
| FirebaseDatabase | Provider for initializing [Realtime-Database] instance with the provided FirebaseApp and creating @pankod/refine [dataProvider] |## License
[MIT](http://vjpr.mit-license.org)
[firebaseoptions]: https://firebase.google.com/docs/reference/js/app.firebaseoptions.md?authuser=0#firebaseoptions_interface
[firebaseapp]: https://firebase.google.com/docs/reference/js/app.firebaseapp.md?authuser=0#firebaseapp_interface
[iauthcontext]: https://refine.dev/docs/api-references/providers/auth-provider/#api-reference
[firebase-authentication]: https://firebase.google.com/docs/reference/js/auth.md?authuser=0#functions
[dataprovider]: https://refine.dev/docs/api-references/providers/data-provider
[firestore]: https://firebase.google.com/docs/reference/js/firestore_.md?authuser=0#@firebase/firestore
[realtime-database]: https://firebase.google.com/docs/reference/js/database.md?authuser=0#database_package