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
14
votes
3 answers

Cloud Storage for Firebase access error "admin.storage(...).ref is not a function"

I am working with Cloud Storage for Firebase and can't figure out how to to access storage files According to https://firebase.google.com/docs/storage/web/start official guide and https://firebase.google.com/docs/storage/web/create-reference this…
Abdullah
  • 2,015
  • 2
  • 20
  • 29
14
votes
2 answers

Can I reset a user's password using the Firebase Admin SDK for Node?

The docs from Firebase suggest that the API offers the same features as the console: It is not always convenient to have to visit the Firebase console in order to manage your Firebase users. The admin user management API provides programmatic…
Oliver Lloyd
  • 4,936
  • 7
  • 33
  • 55
14
votes
4 answers

How to get all of device tokens from Firebase?

How to get device tokens (FCM registration tokens) from Firebase? I'm making mobile app using firebase and its server using node.js. I want to send push notification message from server, but I don't know how to get devices token. How to get…
ton1
  • 7,238
  • 18
  • 71
  • 126
13
votes
1 answer

How to set storage rules so I can run my Firebase storage emulator?

When I run firebase emulators:start I have this error Error: Cannot start the Storage emulator without rules file specified In firebase.json Before installing Storage emulator, I can set the rule for Firestore like this { "firestore": { …
13
votes
1 answer

Can I create a federated user in firebase manually using admin authentication api?

I've a web application built using firebase. In my web app, I've google, firebase, twitter signup/signin functionalities. Now I want to integrate this with my api.ai agent and have a seamless account linking. Hence users will use their googel Home/…
13
votes
1 answer

Firebase Cloud Functions Database Trigger 'onCreate is not a function'

I want to use onCreate method instead of onWrite for the sake of efficiency but I face that error: functions.database.ref(...).onCreate is not a function. However, there seems to be a function as mentioned in the doc…
12
votes
4 answers

The Cloud Functions emulator requires the module "firebase-admin" to be installed

Continuing to try to get firebase serve to work again. I just asked this question (and got a good reply, thanks): npm ERR! peer dep missing: firebase-admin@^7.0.0, required by firebase-functions@2.3.1 When doing npm list firebase-admin I now see the…
Leo
  • 4,136
  • 6
  • 48
  • 72
12
votes
3 answers

How to use Firebase Admin SDK in Flutter?

I'm creating a app where I should be able of managing users access. The admin should have permissions of creating, deleting and editing users accounts. I'm using firebase for creating users account. Right now individually users can creating, editing…
Alex Silva
  • 125
  • 1
  • 2
  • 5
12
votes
3 answers

Detected an object of type "Timestamp" that doesn't match the expected instance

I'm wondering why is the Timestamp object is not working as I expect? It works in test environment (I use Mocha), but throws error when it has been deployed. index.ts import { Timestamp, QuerySnapshot } from "@google-cloud/firestore"; .... async…
12
votes
3 answers

How to make Firebase Functions act as a user instead of being an admin?

My client app is accessing to Firestore through API created by Firebase Functions. However, the Firebase Functions imports firebase-admin which bypass all the defined security rule. Is there any way I can make my HTTP triggers Function to act as a…
12
votes
4 answers

Firestore moving to timestamps in Firebase functions

Yesterday, all my firebase functions started throwing the following warning: The behavior for Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK. To hide this warning and ensure your app does not break, you need to add…
12
votes
1 answer

Firebase admin sdk: idToken OR custom token verification for authorization

I'm creating a custom token on backend server while login and below is the code: UserSchema.methods.generateAuthToken = function() { var user = this; var access = "auth"; return firebaseAdmin.default .auth() …
12
votes
5 answers

How to set log level for Firestore?

How to set log level for Firestore? According to documentation here, i should use setLogLevel method but i can't see method at Firestore client objects, like FirestoreClient.getFirestore().
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
12
votes
4 answers

ImportError: Failed to import the Cloud Firestore library for Python

Trying to integrate Google firestore API at python server ... File "/home/daffolap-355/repos/subscriptions/appvendor/firebase_admin/firestore.py", line 28, in raise ImportError('Failed to import the Cloud Firestore library for Python.…
12
votes
1 answer

how to set server time stamp with firestore admin nodejs sdk?

const firebase = require('@firebase/app').default; require('@firebase/firestore') const admin = require('firebase-admin') const functions = require('firebase-functions') // initialize the admin SDK... exports.setUpdatedDate =…