ra-auth-firebase-client
v3.0.0
Published
auth provider for react-admin framework
Downloads
3
Readme
ra-auth-firebase-client
Requirements
npm install firebase
Install
npm install --save ra-auth-firebase-client
Usage
import { Admin, Resource } from 'react-admin'
import {emailAndPasswordAuthProvider} from "ra-auth-firebase-client";
import { PostList, PostEdit, PostCreate } from './Posts'
import dataProvider from 'your-data-provider';
import firebase from 'firebase/app'
import 'firebase/auth'
firebase.initializeApp({
apiKey: '**************',
authDomain: '**************',
databaseURL: 'https://myrealtimedatabase.firebaseio.com',
projectId: 'myrealtimedatabase',
storageBucket: 'myrealtimedatabase.appspot.com',
messagingSenderId: '**************',
appId: '**************',,
measurementId: '**************'
})
export default () =>
<Admin authProvider={emailAndPasswordAuthProvider(firebase)} dataProvider={dataProvider} >
<Resource name='posts' list={PostList} edit={PostEdit} create={PostCreate} />
</Admin>
Result
console.log(localStorage.getItem("user"))
Demo
https://aymendhaya.github.io/ra-auth-firebase-client
Notice
- this is a basic migration to v3
- a lot of functionalities will be added soon
- please feel free to suggest new functionnalities
About dataProvider
Firebase dataProvider is a separate project. Check ra-data-firebase-client