Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Firebase JavaScript SDK and react-native-firebase

I am trying to use to use Firebase (Cloud Firestore) for a react-native app, to store my JSON objects.

I ve seen people using Firebase in their apps (npm install firebase), and others using react-native-firebase.

Most blogs say that Firebase itself is meant for web, so their react-native support is none/less. While a few other blogs and firebase official blog say that Firebase supports react-native.

I am not sure which library to choose, for my react-native project, and what's the difference between them.

like image 852
kernelman Avatar asked Oct 01 '18 10:10

kernelman


People also ask

What is the difference between Firebase and React Native Firebase?

Firebase belongs to "Realtime Backend / API" category of the tech stack, while React Native Firebase can be primarily classified under "Platform as a Service Tools". Some of the features offered by Firebase are: Add the Firebase library to your app and get access to a shared data structure.

What is Firebase JS SDK?

Firebase SDKs provide authentication methods for developers, so they don't have to reimplement common login systems such as Google or Facebook login. This includes UI elements in the Web, Android, and iOS SDK versions for Firebase, however, these UI components do not work with React Native and should not be called.

Is Firebase good with React Native?

Firebase is a Backend as a Service (BaaS) that provides an advantage to mobile developers who use React Native for developing mobile applications. As a React Native developer, by using Firebase you can start building an MVP (minimum viable product), keeping the costs low and prototyping the application pretty fast.

What is Firebase React Native?

React Native Firebase is a collection of official React Native modules connecting you to Firebase services; each module is a light-weight JavaScript layer connecting you to the native Firebase SDKs for both iOS and Android.


2 Answers

According to project description on GitHub:

React Native Firebase is a light-weight javascript layer connecting you to the native Firebase SDKs for both iOS and Android which aimes to mirror the offical Firebase Web SDK as closely as possible.

Although the official Firebase JS SDK will work with React Native; it is mainly built for the web and has a limited feature-set compared to native.

So, you should choose it, for react native platform. This will allow you to use more features and also benefit from using native sdk's (speed, memory consumption, etc.)

like image 83
Dima Rostopira Avatar answered Sep 21 '22 20:09

Dima Rostopira


Add up from Dima Rostopira's Answer.

You need to use JS SDK in react native when you use expo. Because expo not let you add custom native modules. Else go with react native SDK

like image 35
b.ben Avatar answered Sep 24 '22 20:09

b.ben