firebase-js-sdk | Firebase Javascript SDK | Authentication library
kandi X-RAY | firebase-js-sdk Summary
kandi X-RAY | firebase-js-sdk Summary
The Firebase JS SDK is built with a series of individual packages that are all contained in this repository. Development is coordinated via yarn workspaces and Lerna (a monorepo management tool). Each package in the packages directory, constitute a piece of our implementation. The SDK is built via a combination of all of these packages which are published under the firebase scope on NPM.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of firebase-js-sdk
firebase-js-sdk Key Features
firebase-js-sdk Examples and Code Snippets
Community Discussions
Trending Discussions on firebase-js-sdk
QUESTION
I have a Firebase real-time database integrated with React Native where I can create users. But my problem is that when I try to log in I get an error. I run my app on IOS if it makes any difference. I have followed this guide: How to Build a React Native App and Integrate It with Firebase. I use the method Email/Password for login. I use Firebase version 9.6.4.
I have looked through this thread: Could not reach Cloud Firestore backend. and tried all the solutions but nothing works for me.
Any suggestions on what possibly could cause the error and how do I solve it?
Error message:
[2022-01-29T10:35:40.257Z] @firebase/firestore:, Firestore (9.6.4): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=permission-denied]: Cloud Firestore API has not been used in project xxxx before or it is disabled. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
Firebase config.ts
file:
ANSWER
Answered 2022-Feb-10 at 05:23Your error message says FirebaseError: [code=permission-denied]: Cloud Firestore API has not been used in project xxxx before or it is disabled.
The app tries to read a user document after signing in, but seems to have no access.
Check your firestore rules in your firebase console to see if read rules are valid. Firestore may have initialized with rules that allow only admin users to read/write, or rules that allow all read/write only for a month after its creation.
To make your app work, your firestore rules need to allow read access on users collection. Here are the rules you can set on your firestore. The more specific rules you set, the more secure the app is.
Allow unauthenticated access on all collections
QUESTION
I saw many questions on SO regarding this issue and none of them was answered (or the solution doesn't work), I don't know why. People are having this error continuously but no solution is being provided. And from past few days even I'm encountering this error (Note: It seems to be working fine on my physical device (not while debugging, it works on only if I release it), but not on android emulator, so I'm pretty sure my internet is working fine):
...ANSWER
Answered 2022-Feb-10 at 06:51Found out the solution on my own after a lot of search. Although I had to make a new bare react native project from scratch, and even then I was encountering that error, I had literally lost hope with firebase at that point. Then after sometime I changed my firebase
config to the below code and it worked:
QUESTION
I have a parent class Parent
from a lib with some properties and a child class Child
which have the same properties but with different types.
ANSWER
Answered 2021-Dec-21 at 11:12If Parent
's propertyA
is of type string
, Child
's propertyA
must also be of type string
, because of the Liskov substitution principle. A Child
has to "be a" Parent
, and that means that code with a Parent
reference to a Child
object must be able to treat it as though it were a Parent
object. That code will expect a string
, not a number
.
Since that's not the case for what you're doing, inheritance probably isn't the appropriate approach. You might try composition instead: Child
could have a field of type Parent
.
Alternatively, have Child
leave propertyA
alone and have another property for the number
.
QUESTION
in a VueJS / QuasarJS application Im using firebase-js-sdk
[1] together with firebaseui-web
[2] to handle authentication.
After successful auth with any of the configured providers (e.g. password, google, apple, etc) I want to check which provider the user used. But immediately after successful authentication the user.providerData[]
array that should contain the information is empty.
BUT if I reload my app the user.providerData[]
array is suddenly populated correctly.
I´m checking for user data with something like this
...ANSWER
Answered 2021-Nov-13 at 23:13Your code is only running once instead of running every time the auth state is updated.
If you want to listen to any changes to the auth state, use a callback along with onAuthStateChanged
as described here.
https://firebase.google.com/docs/auth/web/manage-users#get_the_currently_signed-in_user
QUESTION
As far as I can tell, Firestore uses protocol buffers when making a connection from an android/ios app. Out of curiosity I want to see what network traffic is going up and down, but I can't seem to make charles proxy show any real decoded info. I can see the open connection, but I'd like to see what's going over the wire.
Firestores sdks are open source it seems. So it should be possible to use it to help decode the output. https://github.com/firebase/firebase-js-sdk/tree/master/packages/firestore/src/protos
...ANSWER
Answered 2021-Nov-10 at 09:03A few Google services (like AdMob: https://developers.google.com/admob/android/charles) have documentation on how to read network traffic with Charles Proxy but I think your question is, if it’s possible with Cloud Firestore since Charles has support for protobufs.
The answer is : it is not possible right now. The firestore requests can be seen, but can't actually read any of the data being sent since it's using protocol buffers. There is no documentation on how to use Charles with Firestore requests, there is an open issue(feature request) on this with the product team which has no ETA. In the meanwhile, you can try with the Protocol Buffers Viewer.
Alternatives for viewing Firestore network traffic could be :
From Firestore documentation,
For all app types, Performance Monitoring automatically collects a trace for each network request issued by your app, called an HTTP/S network request trace. These traces collect metrics for the time between when your app issues a request to a service endpoint and when the response from that endpoint is complete. For any endpoint to which your app makes a request, Performance Monitoring captures several metrics:
- Response time — Time between when the request is made and when the response is fully received
- Response payload size — Byte size of the network payload downloaded by the app
- Request payload size — Byte size of the network payload uploaded by the app
- Success rate — Percentage of successful responses compared to total responses (to measure network or server failures)
You can view data from these traces in the Network requests subtab of the traces table, which is at the bottom of the Performance dashboard (learn more about using the console later on this page).This out-of-the-box monitoring includes most network requests for your app. However, some requests might not be reported or you might use a different library to make network requests. In these cases, you can use the Performance Monitoring API to manually instrument custom network request traces. Firebase displays URL patterns and their aggregated data in the Network tab in the Performance dashboard of the Firebase console.
From stackoverflow thread,
The wire protocol for Cloud Firestore is based on gRPC, which is indeed a lot harder to troubleshoot than the websockets that the Realtime Database uses. One way is to enable debug logging with:
QUESTION
I just updated my Expo mobile application from firebase@9.0.0-beta.7 to firebase@9.0.1 and came across following error: @firebase/firestore: Firestore (9.0.0): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
.
I'm running mobile app in Expo Go with android studio emulator.
In application Auth works fine as I can log user in and out but when I try to do something with Firestore I get following error: Failed to get document because the client is offline.
This happens for example in basic getDoc() function
ANSWER
Answered 2021-Oct-16 at 13:17I can get it to work by using this setting:
QUESTION
After I run npm start
This is my result is ...
...ANSWER
Answered 2021-Oct-01 at 17:24chnage the .js
file to
QUESTION
node: 14.15.5
OS: macOS Big Sur v11.2
When I try to run test with Jest, test fails with an error message that "TypeError: firebase__default.default.initializeApp is not a function"
even if I use initializeTestApp
, not initializeApp
- I used
@firebase/rules-unit-testing ver2.0.0
but there was noinitializeTestApp
function so I downgraded the version to 1.3.14 as described below. - I deleted
yarn.lock
file and use commandyarn install
but it did not work. - I searched issues but there is no exact the same issue.(this is similar issue: https://github.com/firebase/firebase-js-sdk/issues/4944)
I would really appreciate if you can give me any advices. Thank you.
firebaseRules.test.ts
...ANSWER
Answered 2021-Sep-08 at 08:53I don't know why but the new versions of the package don't work well and the method is no longer in, I downgraded the package to version "^1.3.7".
Change in your package.json:
QUESTION
The new version 9 of the Firebase JS SDK has arrived with a more modular approach, and I'm trying to wrap my head around it.
I want to find and read a document from Firestore by its ID. In version 8, you could do:
...ANSWER
Answered 2021-Sep-01 at 10:48The documentation has a complete code snippet explaining how to fetch a single document with given ID:
QUESTION
I've been trying to troubleshoot my project for the past day or so with no luck so far. Haven't documented the steps I've taken so far but will do my best to give an overview.
Yesterday my app was running fine, I went to open the remote debugger, the app crashed with an error. I assumed it was nothing and carried on debugging for a bit. Eventually I started getting the error.
...ANSWER
Answered 2021-Mar-27 at 21:30Insert window.addEventListener = x => x; at the top level of your app.
There is no global window.addEventListener
function in React Native. The execution environment is different from a web browser.
(errors installing Firebase)
You can install firebase@8.2.3
- yarn add firebase@8.2.3
and I believe they've removed the grpc dependency in that version. Building native dependencies for Node packages commonly fails on Windows machines for a variety of reasons, you should search issues on repositories related to those packages for more information when you encounter in the future. eg: https://github.com/grpc/grpc-node/issues/1183
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install firebase-js-sdk
Once you have Node.js and yarn installed on your machine and have validated that you are running the proper version, you can set up the development environment by running the following at the root of the SDK:.
A production project is required to test the Firebase JS SDK. You can create a new project by visiting the Firebase Console.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page