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
10
votes
4 answers

How to fix Firebase_Admin Error TypeError: __init__() got an unexpected keyword argument 'status'

I'm new to Firebase and I am following their tutorial online. I'm trying to authenticate into a quick DB that I created with a few records. I'm getting the error: TypeError: init() got an unexpected keyword argument 'status' I've made sure my…
killsburydouboy
  • 309
  • 1
  • 3
  • 14
10
votes
2 answers

google function: accessing firestore database of another project

I would like a Google Cloud project A (project-a-id) to access the firestore data of another Google Cloud project B (project-b-id). For the same I added project A default service account viz. project-a-id@appspot.gserviceaccount.com in the IAM of…
10
votes
5 answers

How to compare firebase timestamps?

I have cloud function code code like this: console.log(`ts: ${(element.get('expire') as admin.firestore.Timestamp).toDate().toUTCString()} now: ${admin.firestore.Timestamp.now().toDate().toUTCString()}`) const greater = (element.get('expire') as…
10
votes
1 answer

How to get users from Firebase auth based on custom claims?

I'm beginning to use custom claims in my Firebase project to implement a role-based authorization system to my app. I'll have a firebase-admin script which is going to set {admin: true} for a specific user's uid. This will help me write better and…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
10
votes
2 answers

How to Import FieldValue from firebase-admin using Typescript?

Is it possible to import FieldValue from firebase-admin npm using this style? import { FieldValue } from 'firebase-admin/firestore'; By default my visual studio Code imports in this way: import {FieldValue} from '@google-cloud/firestore'; but in…
10
votes
1 answer

Firestore: "add is not a function"

I try to use Firestore in Cloud functions but I faced with error db.collection(...).doc(...).collection(...).doc(...).add is not a function at Promise I read these topics first, second and other. But id didn't help me. The package.json looks…
Alexander Khitev
  • 6,417
  • 13
  • 59
  • 115
9
votes
0 answers

Docker build timeouts on AWS Beanstalk for Python app

I have a Python2/Django application running on AWS Beanstalk. I use Dockerfile for deployment. Everything was working fine until I added firebase-admin==3.2.1 dependency to my requirements.txt. What happens is that the Docker image build time took…
9
votes
1 answer

Error on firebase admin nodejs Permission iam.serviceAccounts.signBlob is required

im using this tutorial: https://firebase.google.com/docs/auth/admin/create-custom-tokens#using_a_service_account_id to create a node.js function (deployed to google cloud functions) to authenticate my users. the function is super simple: const admin…
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
9
votes
2 answers

Firebase One-time Functions

I'm sure these are common scenarios, but after researching some hours, I couldn't really find what the common practice is. Maybe someone with more experience in Firebase can point me to the right direction. I have two particular scenarios: 1. Code…
9
votes
1 answer

How to create document Id for firestore documents using adminSdk in Firebase cloud functions?

How to create a document push id for firestore document using Firebase Admin SDK in Firebase cloud function. I know how to do it in Angular using AngularFire2 const bookingId = this.afs.createId(); I need to do this thing in my cloud function.
9
votes
1 answer

Firebase Admin Go SDK getting x509 certificate error ONLY when running inside Kubernetes

I'm currently working on a project using the Firebase Admin Go SDK to handle auth and to use the real time database. The project works correctly when I run it locally (by just running go run main.go). When I run it in Minikube via a docker image (or…
9
votes
2 answers

As an admin, can I modify a Firebase user's email address?

We had a user signup with an invalid email address (@gmail.comp) so as soon as he loses his session, he's going to be permanently locked out since password reset emails won't get to him. We don't have "change your email" functionality built and even…
imjared
  • 19,492
  • 4
  • 49
  • 72
9
votes
0 answers

How do I create the correct FIREBASE_CONFIG environment variable?

I am attempting to write to CloudFirestore via my node/firebase app and have found the docs to be a little unclear. When I compile my app, the terminal states: Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin…
Remy
  • 822
  • 12
  • 18
9
votes
3 answers

Create user with firebase admin sdk that can signIn using email and password

I'm using firebase admin SDK on cloud functions to create users using admin.auth().createUser({ email: someEmail, password: somePassword, }) now I want user to signIn using signInWithEmailAndPassword('someEmail', 'somePassword') but I cannot. I…
9
votes
2 answers

TypeError: Object of type 'Tag' is not JSON serializable

I am trying to create a JSON object and send it to the Firebase Database using python, but when I do this I get: TypeError: Object of type 'Tag' is not JSON serializable Here is my code: data = {'address': address, 'name': name …
anho
  • 1,705
  • 2
  • 20
  • 38