Skip to content

rinfimate/refine-firebase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm npm bundle size (version) npm GitHub GitHub Repo stars

Refine-Firebase

Firebase integration tool for your Refine app

Install

npm i @rinfimate/refine-firebase

Usage

1. Create a config file and initialize firebase.

firebaseConfig.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

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

import {firebaseAuth, firestoreDatabase }from "./firebaseConfig";

 <Refine
      dataProvider={firestoreDatabase.getDataProvider()}
      authProvider={firebaseAuth.getAuthProvider()}
    >

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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.2%
  • JavaScript 3.8%