Questions tagged [firebase-admin]

The Firebase Admin SDK is a set of client libraries which enable App Developers to write more custom behavior for their apps by providing server technologies access to Firebase APIs. Currently, there are libraries for Node.js, Java, Python and Go.

Firebase Admin SDK grants elevated privileges on the server-side, to features like:

  • Firebase Database (Realtime Database and Cloud Firestore)
  • Firebase Authentication
  • Firebase Storage
  • Firebase Cloud Messaging
2205 questions
6
votes
2 answers

Firebase - TypeError: admin.auth(...).createUserWithEmailAndPassword is not a function

I am trying to create a user in firebase database using cloud functions. This is my code : exports.AddUser = functions.https.onRequest(function(req, res){ if(req.method == 'GET'){ email = req.query.email; password =…
6
votes
5 answers

File upload with filestreams and Firebase cloud functions + cloud storage

I've written the following code for my QR file upload using firebase cloud functions const functions = require('firebase-functions'); const qrcode = require('qrcode') const admin = require('firebase-admin'); const spawn =…
6
votes
0 answers

Can Firebase admin SDK retrieve user auth tokens?

The firebase javascript client SDK has sustained access to, say, a facebook oauth token. My understanding is an app can just call firebase.auth.FacebookAuthProvider.credential() and if it is signed in, it will receive a facebook access token with…
Nth.gol
  • 746
  • 9
  • 20
6
votes
1 answer

Google Firebase real time database updateChildren() method is not working?

In my application, I am using google firebase real-time database with admin-sdk for Java. When I run a sample program from my machine it works perfectly and updates the given data into firebase db. But, when I try to run the same program from…
6
votes
1 answer

Firebase Cloud Functions "admin.messaging(...).send is not a function"

I have a function in Firebase Functions service that send any FCM. I would to use admin.messaging().send() function, like this reference guide, but I got this error while function is triggered, not during deploy: TypeError: admin.messaging(...).send…
6
votes
0 answers

FIREBASE WARNING: Invalid query string segment:

I keep having these warnings in the Firebase Logs Console: "FIREBASE WARNING: Invalid query string segment:" I checked everything but I can't find some reasons. Do you have any ideas ? Configuration { "name": "functions", "description": "Cloud…
6
votes
1 answer

Any possibility to access firebase admin through functions internally?

I need to access firebase admin through Firebase functions. I have a function that is being called through an HTTP trigger, and will create custom auth tokens. In the Firebase admin documentation, they say that you need to refer to the JSON file…
Giovanni Palusa
  • 1,197
  • 1
  • 16
  • 36
6
votes
0 answers

What is the purpose of firebase-admin?

I have an ember application using firebase as the database. At one point, I need my nodejs server to have authentication in order to read/write to the database. If I don't need authentication, I could just do the following: firebase =…
Cameron
  • 2,805
  • 3
  • 31
  • 45
6
votes
1 answer

Allowing write access only to Cloud Functions for Firebase

How can we secure database via the rules that only allow Cloud Functions for Firebase to write data to certain locations, previously there was an option to add uid to admin client databaseAuthVariableOverride and use that uid in rules section, but…
Ilja
  • 44,142
  • 92
  • 275
  • 498
5
votes
2 answers

Firebase credentials as Python environment variables: Could not deserialize key data

I'm developing a Python web app with a Firestore realtime database using the firebase_admin library. The Firestore key comes in form of a .json file containing 10 variables. However, I want to store some of these variables as environment variables…
5
votes
5 answers

'An error occurred when trying to authenticate to the FCM servers' on Firebase Cloud Functions

I'm trying to send a message to a topic with FCM in a Firebase Cloud Function triggered when a Firestore document (a message) is created. Subscribing to the topic (also done with Functions) and triggering the send function works fine, but the actual…
5
votes
1 answer

Importing AuthError in TypeScript using Firebase

Is there a way I can check if an error is of type "AuthError" in TypeScript when using Firebase. I have an Https Callable function that has a try/catch block that includes the following: try{ await admin.auth().getUser(data.uid); // will throw…
5
votes
1 answer

Firebase-admin Firestore node.js share logic with modular v9 js sdk

What is the recommended way to share Firestore api logic (between the admin node.js and the js web) when upgrading to the web v9 modular sdk? The way I did it before was just supplying the db (and deleteField) if it was used by a serverless…
5
votes
2 answers

Firebase storage emulator ignored by go admin sdk

I'm trying to setup the storage emulator for my firebase project. I am using the Go admin sdk. However it seems to be ignored despite following the documented process. App initialization: func App(ctx context.Context) (*firebase.App, error) { …
5
votes
1 answer

How to link Email/Password sign-in method using Firebase admin SDK?

I'm trying to use firebase admin SDK in order to link the Email/Password sign-in method. Based on firebase documentation we can links user to a specific provider…