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
2 answers

How to add element to array at firestore database? (python)

I need to add some value (val) to existing array in google.cloud.firestore document. I found solution like that: database.collection('collection_name').document('document_id').update({'array_name': firestore.ArrayUnion([val])}) where 'array_name'…
0
votes
1 answer

How do I interact with the Firestore database through the firebase admin?

I can't find the answer to this in the documentation. I have created a firebase cloud function which listens to the database and gets triggered when a doc in the database changes. What I want the function to do is to gather information from the…
0
votes
1 answer

FirebaseAuth creating custom tokens

When you create a custom token using the below method, is a unique token generated every time even if the uid is the same? Or will it always generate the same token for the same uid in an…
BlueBoy
  • 798
  • 1
  • 11
  • 22
0
votes
0 answers

Why does Firebase Service Account credential JSON not have the form of a JSON?

I have not attempted to use the Firebase Admin SDK for some time, so I apologize if this ends up being trivial but I have spent two days on this. I am creating a new web and mobile app using Firebase, for which I have a data model layer shared…
0
votes
0 answers

firebase admin storage upload results in blurry image

I am using firebase admin storage to upload images. On my computer the images look fine but after uploading them to firebase they look pixelated and blurry. "firebase": "^9.6.9", "firebase-admin": "^10.0.2", here is my code. The downloadUrl is the…
Omar
  • 2,726
  • 2
  • 32
  • 65
0
votes
1 answer

Firebase Admin => Storage upload => How to find a download url?

I am using firebase Admin SDK for Nodejs. To successfully upload files. Now i need to use the upload response to determine a download url to be saved in a database... This was easy enough on the frontend but admin doesnt seem to document…
Omar
  • 2,726
  • 2
  • 32
  • 65
0
votes
1 answer

Can firebase admin sdk be used to verify app check tokens on custom backends?

App check is a great source to protect firebase backend services, but I was wondering if we could also utilise it on custom backends similar to how custom backends can verify firebase's auth tokens? Here is example use case scenario (was only able…
Ilja
  • 44,142
  • 92
  • 275
  • 498
0
votes
1 answer

How can I create and run a transaction that writes to two Firestore?

I have two applications, each belonging to a different firebase project. I want to write to both Firestore with the same transaction. How can I do this? import admin from "firebase-admin"; const primaryFirebase = admin.initializeApp(); const…
0
votes
1 answer

How to copy a file from one dir to another in Firebase Storage with the Admin SDK

I want to copy a file in Firebase Storage from one location /dir/a/myfile.jpg to /dir/b/myfile.b using the AdminSDK with Kotlin/Java. My code for uploading the file is below. How can I copy the file to another directory without uploading it twice? …
finisinfinitatis
  • 861
  • 11
  • 23
0
votes
1 answer

Upload image to Firebase using Django

I have a Django rest API, in which there is an API to get an image from formdata. from django.shortcuts import render from django.http.response import JsonResponse from rest_framework.parsers import JSONParser from rest_framework import…
0
votes
1 answer

Get and increment in Firebase Realtime

I'm making a Firebase function, that is supposed to get the value of a field in the Realtime Database, write the value in a Firestore Document and increment the original field. The problem is when the function gets called very frequently e.g. 500…
0
votes
2 answers

How to access admin firestore using firebase admin SDK?

I am working on an application, where it uses Next.js and Firebase. I need to implement server-side authentication. Firebase allows connecting the server using Firebase Admin SDK. const admin = require("firebase-admin"); const serviceAccount =…
0
votes
2 answers

How can I get a Url that include Path of a Json File instead of Passing the Locally Path Using Firebase

Is there any way to upload the Credential File to the Firebase and only pass a path for this file from firebase to authenticate. For Example: here I need to pass the credential file which is in my local computer I need to pass a path from the…
saad tabban
  • 285
  • 3
  • 12
0
votes
1 answer

heads-up notification not showing on background or terminated state using Firebase Admin Sdk with Laravel

I have integrated Firebase Cloud Messaging to my Flutter mobile app with a plugin called flutter_local_notifications for showing heads-up notification in every state of the app. Everything is working fine until I created a Laravel project for…
0
votes
1 answer

How to debug firebase_admin on python

I am having trouble debugging firebase_admin. I know that my auth token is working, as the login bit works, but the second I try to access a document from the firestore, things get "silent". Doing this: from firebase_admin import firestore def…
David
  • 646
  • 1
  • 7
  • 27