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

Firebase initialization inside a spring bean is not firing onDataChange

I am using firebase admin sdk for java. When I created a java console application, this code below works as expected. But if I put the same code, in the initialization of a bean in a springboot application, it never goes inside the onDataChange…
developer747
  • 15,419
  • 26
  • 93
  • 147
5
votes
1 answer

What set of APIs count towards Firebase Auth API limits (500requests/second)?

The firebase auth doc shows that you can only make Firebase Auth API calls up to 500 requests/second per service account & 1000 requests/second per project. e.g. If I use Firebase Auth Admin SDK to invoke getUserByEmail or updateUser, do these…
user482594
  • 16,878
  • 21
  • 72
  • 108
5
votes
2 answers

Firebase Admin SDK: Set / Merge Custom User Claims

Does Firebase have any trick like { merge: true } to set extra/more custom claims without delete/override the old variables? Step to reproduce: admin.auth().setCustomUserClaims(uid, { a: 'value' }) // Run this…
l2aelba
  • 21,591
  • 22
  • 102
  • 138
5
votes
0 answers

Adding Conversion events to a cloud message using Firebase Admin SDK

I am able to send Push notifications using the code below but I am also required to associate "Conversion events" with the notification. This can be done through the console but I couldn't find how to do it with SDK. var message = new Message() …
5
votes
2 answers

How do I add an analytics label to data messages with the java Firebase Admin SDK?

As of July 1, Firebase requires the addition of labels to messages in order for analytics to show about the number of data message sends etc. 'Starting Monday, 1 July 2019, you will be able to filter data by an analytics label. Data messages sent…
5
votes
1 answer

AWS Lambda Timeout when making external HTTPS Request

I need to use Firebase Admin Java in my AWS Lambda project, but Firebase Auth Admin throws a SocketTimeoutException when it tries to fetch a Public Key within the Google's servers. I know Firebase Admin is configured correctly, because I can run it…
5
votes
3 answers

Calling a firebase cloud function from nodejs

I want to call a cloud function from firebase from another nodejs server or just a nodejs script. My firebase function is an onCall function. I am using https://www.npmjs.com/package/firebase-admin for interacting with firebase but it doesn't seem…
5
votes
1 answer

Firebase functions - admin.firestore() get() throws auth error on local serving

I have a firebase cloud function, which gets the data from the cloud firestore. const userSnapshot = await admin.firestore().collection('users').doc(user).get() when this api is deployed locally using firebase emulators:start. I get the following…
Indhu
  • 9,806
  • 3
  • 18
  • 17
5
votes
1 answer

Firebase auth set custom expiration time for custom token

I am using the firebase custom auth to generate a custom token and I was wondering if there was a way to manually update the token by shortening it based on a specific time a session has finished. e.g. if a session finishes for like 20 seconds or…
5
votes
1 answer

Check if user logged in from backend Firebase Authentication

In my frontend, the user logs in using Firebase Authentication Browser. That part works perfectly fine. In addition to Firebase backend, I also have NodeJS backend that serves additional content. However, I need to serve the content to only…
TSR
  • 17,242
  • 27
  • 93
  • 197
5
votes
2 answers

How do i add Link to firebase cloud messaging with .net admin sdk

I am using the Firebase .net Admin SDK on my back end to send push notifications. According to this link I should be able to add the following json into a message object that will open the set link when the notification is clicked on while the app…
Skbenga
  • 105
  • 1
  • 7
5
votes
1 answer

Is firebase sevices.json needed for admin SDK on cloud functions

I am trying to write a function that writes to a different database when a user writes to the default database , I did my research and i am a little bit confused I saw this on firebase var admin = require('firebase-admin'); var serviceAccount =…
Mayor
  • 303
  • 2
  • 7
5
votes
2 answers

Module Not Found: Can't resolve 'http2' when importing firebase-admin

Failed to compile ./node_modules/@grpc/grpc-js/build/src/channel.js Module not found: Can't resolve 'http2' in '/Users/Michael/Development/Projects/mpsa-ntcs/node_modules/@grpc/grpc-js/build/src' This error occurred during the build…
Mike Pech
  • 61
  • 1
  • 1
  • 6
5
votes
1 answer

Disable many users at once

We are using Firebase Authentication in a multitenant setup. Under certain circumstances, we want to disable all users for one tenant (trial ended, subscription not renewed ...) or enable all previously disabled users. We send an UpdateRequest for…
Kariem
  • 4,398
  • 3
  • 44
  • 73
5
votes
2 answers

Multiple document reads in node js Firestore transaction

I want to perform a transaction that requires updating two documents using the previous values of those documents. For the sake of the question, I'm trying to transfer 100 tokens from one app user to another. This operation must be atomic to keep…
Dori
  • 1,035
  • 1
  • 12
  • 22