https://github.com/aymendhaya/ra-data-firebase-client
firebase data provider for react-admin framework
https://github.com/aymendhaya/ra-data-firebase-client
firebase react-admin
Last synced: 3 months ago
JSON representation
firebase data provider for react-admin framework
- Host: GitHub
- URL: https://github.com/aymendhaya/ra-data-firebase-client
- Owner: aymendhaya
- Created: 2018-09-19T09:35:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-29T11:51:54.000Z (over 5 years ago)
- Last Synced: 2025-09-06T23:22:02.229Z (4 months ago)
- Topics: firebase, react-admin
- Language: JavaScript
- Homepage: https://aymendhaya.github.io/ra-data-firebase-client
- Size: 10.9 MB
- Stars: 55
- Watchers: 6
- Forks: 49
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ra-data-firebase-client
>
[](https://www.npmjs.com/package/ra-data-firebase-client) [](https://standardjs.com)
## Requirements
```bash
npm install firebase
```
## Install
```bash
npm install ra-data-firebase-client
```
## Usage
```jsx
import { Admin, Resource } from 'react-admin'
import firebaseDataProvider from 'ra-data-firebase-client'
import firebase from 'firebase/app'
import "firebase/database";
firebase.initializeApp({
apiKey: '**************',
authDomain: '**************',
databaseURL: 'https://myrealtimedatabase.firebaseio.com',
projectId: 'myrealtimedatabase',
storageBucket: 'myrealtimedatabase.appspot.com',
messagingSenderId: '**************',
appId: '**************',,
measurementId: '**************'
})
const settings = {context: 'dev', imagekey: "images", filekey: "files"}
export default () =>
```
## Result
```json
{
"myrealtimedatabase": {
"dev" : {
"posts" : {
"-M6rfMORj0dfoisK1taJ" : {
"id" : "-M6rfMORj0dfoisK1taJ",
"key1" : "value1",
"key2" : "value2",
"images": [
{
"id": "-M6rfMORj0dfoisK1taJ_img_0"},
"src": "data:image/jpeg;base64......",
"size": 150402,
"title": "my-uploaded-image.jpg"
"type": "image"
{...},
{...}
]
"files": [
{
"id": "-M6rfMORj0dfoisK1taJ_img_0"},
"src": "data:application/pdf;base64......",
"size": 150402,
"title": "my-uploaded-file.pdf"
"type": "file"
{...},
{...}, {...}, {...}]
}
}
}
}
}
```
## Demo
[https://aymendhaya.github.io/ra-data-firebase-client](https://aymendhaya.github.io/ra-data-firebase-client)
## About authProvider
Firebase authProvider on versions < 3 has been moved to a separate project [ra-auth-firebase-client](https://github.com/aymendhaya/ra-auth-firebase-client)