Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

ra-data-firestore-client

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ra-data-firestore-client

Firestore Data Provider for react-admin

latest
Source
npmnpm
Version
0.1.14
Version published
Maintainers
1
Created
Source

ra-data-firestore-client

NPM Version License Downloads/week Github Issues

A Firestore Client for the awesome react-admin framework. This library is a modified version of aymendhaya/ra-data-firebase-client

Pull requests are welcome! 🤝

Features

  • Supports all DataProvider request types (GET_LIST, GET_MANY_REFERENCE etc)
  • Sorting, filtering, pagination
  • AuthProvider with email/password authentication
  • Login enabled to users with admin rights only (how to set it up)
  • Attaching files (also images) in Base64 to Firestore documents (so react-admin ImageInput & FileInput work)

Quick demo

Clone the repository & run

npm install 
npm run init 
npm run demo 

Use in your project

npm install ra-data-firestore-client

Check example implementation.

Set up admin account

Only the Firebase users with admin flag are able to authenticate on the Login screen.

To elevate users rights, add a boolean field isAdmin = true for a user in a Firestore collection /users/, like below:

"users": {
    "<USER_ID>": {
        "isAdmin": true
    }
}

The default collection & field name can be changed by adding authConfig object to AuthProvider constructor:

const authConfig = {
  userProfilePath: '/users/',
  userAdminProp: 'isAdmin'
};

Known limitations

  • Filtering list by a text query works for exact values only
  • Realtime updates are not implemented yet (a draft PR is in progress)
  • No support for Firebase Storage upload
  • Sorting, filtering and pagination are done in memory after fetching all documents from collection (a draft PR is in progress)

Keywords

react-admin

FAQs

Package last updated on 04 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts