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

Got The default FirebaseApp already exists

I make an C# API to push notification to Flutter app. My API basically like code below : public async Task < IActionResult > pushNotification () { FirebaseApp.Create(new AppOptions() { Credential = GoogleCredential.FromFile("file.json") }); …
Alex
  • 727
  • 1
  • 13
  • 32
6
votes
2 answers

Firestore client in python (as user) using firebase_admin or google.cloud.firestore

I am building a python client-side application that uses Firestore. I have successfully used Google Identity Platform to sign up and sign in to the Firebase project, and created a working Firestore client using google.cloud.firestore.Client which is…
6
votes
1 answer

How to delete a user and their Firestore document in a callable cloud function

I'm creating a cloud function in firebase and need some help,I'm trying to delete a user form firebase and delete his document from firestore in one cloud function. How can I make a batch job / transaction for both auth and firestore, lets say the…
6
votes
2 answers

Firebase - create a temporary user until the user signs up

I have a use case where User A can say that User B borrowed from User A some amount of money, similar to apps like Splitwise. I'm using firestore to store the data. In this particular case, I'll store it as a document in the "Transactions"…
Akshay Jain
  • 884
  • 5
  • 19
6
votes
2 answers

Mock a token for flask unit tests - firebase-admin-python SDK

I am using the firebase-admin-python SDK to handle authentication between an iOS app and a flask backend (python). This is my backend authentication endpoint, following the firebase guide: from flask import request from firebase_admin import…
user5791460
6
votes
0 answers

How to unlink facebook login for a firebase user?

I enabled facebook login in firebase authentication sign-in method. As per fb app submission requirements, when a user deletes/deauthorizes my app from fb, I need to delete/deauthorize all the user data that my app has taken from facebook. This…
6
votes
1 answer

Im having trouble while serving or deploying Firebase Hosting Functions

The Cloud Functions emulator requires the module "firebase-admin" to be installed. This package is in your package.json, but it's not available. You probably need to run "npm install" in your functions directory. I was running well my…
6
votes
2 answers

How to create a folder in Firebase Storage using Admin API

Aim: to upload a file into a folder within Firebase Storage E.g. default_bucket/folder1/file1 default_bucket/folder1/file2 default_bucket/folder2/file3 Using Firebase client-side I am able to upload a file to a folder within Firebase Storage like…
Kildareflare
  • 4,590
  • 5
  • 51
  • 65
6
votes
3 answers

Google Firebase: Get, update or create documents using Python

I am not able to get, update or create the documents in Google Firebase (Cloud Firestore) database using Python. What I have: A) The database with a collection and documents (inserted manually on the web): B) Credential JSON file saved as test.json…
Michal Skop
  • 1,349
  • 1
  • 15
  • 23
6
votes
4 answers

Firebase Storage-How to delete file from storage with node.js?

I want to delete a folder in firebase storage with node js because this is a firebase function. For example : storageRef.child(child1).child(child2).delete(); something like this, but firebase documentation doesn't tell anything. One more…
6
votes
2 answers

Python Firebase Admin SDK appears successful but I never receive the notification

I'm attempting to use the Python Firebase Admin SDK to send push notifications for my mobile app. I've tested it with the notification composer in the Firebase Console, so I know my device can receive push notifications, but when I try to use the…
6
votes
1 answer

Firebase storage : list files in a specific directory

How to list files in Firebase storage in a specific directory (eg: /test), Here is what I tried : var query = { delimiter: 'test/' }; const storageRef = admin.storage().bucket().getFiles(query, function(err, files, nextQuery, apiResponse) { …
6
votes
1 answer

Firebase Cloud Functions TS - Unresolved functions/variables/methods

I use the IDE WebStorm, and I'm having some difficulties coding the cloud functions. It looks like WebStorm doesn't recognize some methods/ functions/variables of firebase. Example: The dark red color means that it couldn't resolve the property. As…
6
votes
2 answers

Firebase Admin SDK - Check user's password against variable on server

I am trying to implement a feature for a user to change their password in their settings page when they are logged in, and I require the user's old password as well as the new password when they try to change it as an extra security measure. My…
user10055179
6
votes
2 answers

Updating documents in Cloud Firestore based on a query

is it possible to set values with firebase cloud function that includes a where clause? E.g admin.firebase.firestore().collection('Accounts').where("imagePathName", '==', docNamed).set({ original: 'trial' }); this is giving me an error.
Yushin
  • 1,684
  • 3
  • 20
  • 36