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
0
votes
1 answer

Deploy Firebase private key json file to App Engine

I have a App Engine project I am deploying through Gitlab CI to Google Cloud App Engine. The project uses Firebase Admin. To authorize the application a secret file called private-key.json containing the credentials is required. To handle this file…
Simon
  • 4,395
  • 8
  • 33
  • 50
0
votes
1 answer

Is there any fix available for Dicer vulnerability with Firebase admin?

I am trying to deploy my Firebase app using GitHub actions. I am running below commands for the same: npm install npm audit fix npm install firebase-tools@10.9.2 It was working perfect till 10 days back now suddenly I am getting below issue: Crash…
0
votes
1 answer

Firebase Admin getAuth crashes Node server when error

I'm using some middleware to authenticate my REST API with a Firebase Auth token and the Firebase Admin SDK. It works perfectly fine when I send a valid token through. Sending an expired or invalid token crashes the node server. Here's the…
0
votes
1 answer

How to upload images on firebase storage using firebase-admin and nodeJS

I was trying to upload an image into my firebase storage but im getting the error Cannot read properties of undefined (reading 'child') This is my code below const admin = require("firebase-admin"); admin.initializeApp({ credential:…
Cyrille Con Morales
  • 918
  • 1
  • 6
  • 21
0
votes
1 answer

Trouble with Addition Assignment in Array from Firebase

I have a scenario where i need to query multiple collections at once and retrieve the values based on the collection name. I use Promise.all to do so and it works accordingly like so var dbPromises = []; dbPromises.push( …
0
votes
1 answer

how to increase value in Realtime Database

const dataFromDbUser = admin.database().ref('Base/' + 'users/'+ userId); dataFromDbUser.on('value',(item)=>{ item.val().money //10 }) how can i increase the value of money? Thank you using node.js this is what the base looks like Base:{ …
0
votes
1 answer

Change GCP default service account while initializing firebase admin using node.js

I am trying to deploy my cloud functions in GCP and post deployment it is linked to a default service account. However, I have provided values for specific service account on which it should get deployed/linked. I am using const admin =…
0
votes
1 answer

Custom generated ID in Firestore NodeJs gets overwritten sometimes

I have 2 collections. a) Products: Stored Products, b) Barcode: Stores a prefix and a counter value which collectively forms a string and is used as ID for a new product. app.post('/saveProduct',…
Tabby
  • 388
  • 1
  • 11
0
votes
1 answer

firebase-admin, is it contradicting to use default credentials and serviceAccountId in same initialization?

I initialize firebase-admin like so for firebase functions: const admin = require('firebase-admin') const { applicationDefault } = require('firebase-admin/app') admin.initializeApp({ credential: applicationDefault(), serviceAccountId:…
0
votes
2 answers

typescript conditionaly set function parameter

Im building api in my next app, this api will send message using firebase fcm admin. This is my code import type { NextApiRequest, NextApiResponse } from "next"; import { getMessaging } from "firebase-admin/messaging"; export default async function…
0
votes
1 answer

Pushing a task with firebase-queue not working

I am trying to use the queuing module base on top of Firebase. I use the following code to push tasks import admin from "firebase-admin"; admin.initializeApp({ credential: admin.credential.cert(process.env.GOOGLE_APPLICATION_CREDENTIALS), …
0
votes
1 answer

custom claim for multi sub users at once using cloud function?

What is the best way to update the custom claim of multiple sub users at once using a cloud function ? I mean is would a forEach on an array of lets say a list of users emails (strings) do this job ? const list =…
Richardson
  • 1,804
  • 10
  • 38
0
votes
2 answers

Fetching Realtime Database in Cloud Function return the wrong object

I'm trying to fetch data from my Realtime database but when I do, it return my this object: {"domain":{"domain":null,"_events":{},"_eventsCount":3,"members":[]}} instead of something like this: {0: 'user1', 1: 'user2'}. There is a screen from my…
0
votes
1 answer

How do I query a firestore document using firebase_admin with get()

I am trying to retrieve a document from firestore using python but I keep seeing a context error. Upon some research I found that the firebase_admin sdk is using async calls and python is not waiting, but with that knowledge I am still unable to…
0
votes
0 answers

FCM and Firebase Admin SDK error : Credentials does not have permission to send messages

I'm facing an issue working with Firebase Cloud Messaging and the Firebase Admin SDK for Node.JS. I have the following code, which is supposed to send a firebase notification to an expo app when this route on the express API is called : const…