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

How to initialize firebase admin using modular Firebase v9?

I'm using firebase admin to interact with Firestore and auth from a custom backend (next.js api routes). Firebase recently announced they're going with modular tree-shaking packages. How can I refactor below code to utilize tree-shaking firebase…
GorvGoyl
  • 42,508
  • 29
  • 229
  • 225
5
votes
2 answers

Can't resolve 'fs' in firebase-admin/lib' when using nextjs monorepo project with lerna

I have a Lerna MonoRepo project setup. Like root/ lerna.json packgae.json package.lock.json packages/ app1 - Create react app (with firebase sdk dependency) app2 - Next Js app (with firebase-admin dependency) …
paritosh raj
  • 151
  • 7
5
votes
2 answers

Why I get this error on python firebase-admin initialize_app()?

when I was trying to connect google firebase real time database, I got this error: ValueError: The default Firebase app already exists. This means you called initialize_app() more than once without providing an app name as the second argument. In…
5
votes
3 answers

Unable to install firebase-admin pip package for python django in Apple M1 chip

Unable to install firebase-admin in Apple M1 Chip System System Configuration System OS: macOS Bigsur(11.2.2) chip: Apple M1 python version: 3.9.2 Pip Version: 20.0.1 Djnago: 3.1.7 I create virtual env for my project using below steps install…
Drashti Javiya
  • 519
  • 1
  • 3
  • 14
5
votes
2 answers

Is it possible to call firebase functions with 'firebase-admin' package?

I have node app with service account based access, so I used firebase-admin. As I could see before, firebase-admin mostly duplicated firebase package (except for authentication part, signatures and maybe some other parts), but now I want to invoke…
Yehor Androsov
  • 4,885
  • 2
  • 23
  • 40
5
votes
2 answers

Can't import firebase-admin in Node.js

I have a Node (14.3.0) server where I enabled ES6 module imports in my package.json by adding the following line: package.json: "type": "module", According to the firebase-admin docs here: https://firebase.google.com/docs/admin/setup/#node.js If…
SamYoungNY
  • 6,444
  • 6
  • 26
  • 43
5
votes
3 answers

The constructor FirebaseOptions.Builder() is deprecated

Firebase gives you the ability to add the Firebase Admin SDK to your server: FirebaseOptions options =…
grooble
  • 617
  • 1
  • 8
  • 27
5
votes
3 answers

possible way to use firebase-admin with Deno

Since Deno has been released stable build just a few days ago, Is there a possible way to use firebase-admin with Deno?
5
votes
1 answer

FCM - why no longer support FCM direct channel in newer Firebase Admin SDK?

I am trying to implement server for FCM to send notifications to android/iOS devices. I need to send data-only notifications to both android and iOS but iOS seems very unstable for background notifications. (even though the app is in foreground, I…
5
votes
5 answers

firebase cannot determine project id

this is the request that I made using node // Initialize the default app var admin = require('firebase-admin'); var app = admin.initializeApp({ credential: admin.credential.applicationDefault(), databaseURL:…
user12551065
5
votes
2 answers

I can't start node.js on hosting

I am trying to install my node.js server in hosting. The server running on Windows but not work in hosting. RUN NPM INSTALL ERRROR An error occured during installation of modules. The operation was performed, but check availability of application…
Pehr Sibusiso
  • 862
  • 1
  • 14
  • 27
5
votes
1 answer

Spring boot - Accessing firebase admin sdk credentials json file from inside a jar

I have a Java Spring Boot backend application that uses Firebase Admin SDK. inside the init method for FirebaseConfig I have to supply the credentials file for the FirebaseOptions, @PostConstruct public void init() throws IOException { …
5
votes
1 answer

How to import firebase-functions and firebase-admin in ES6 syntax for transpiling with Babel for Node 10

I'm currently writing my cloud functions in ES6 and transpiling with Babel to target the Node v10 environment. And I've noticed something weird. Why is that when I import firebase-functions like this: import functions from 'firebase-functions'; I…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
5
votes
3 answers

How to getDownloadURL in a Firebase Function

When using Firebase Storage to store images, there is a URL to the image that looks like this : https://firebasestorage.googleapis.com/v0/b/[MY-APP].appspot.com/o/[FILE-NAME]?alt=media&token=[TOKEN] I want to get this URL. According to this, this,…
kris
  • 11,868
  • 9
  • 88
  • 110
5
votes
1 answer

How to load a firebase admin key in node js?

I want to use the firebase admin SDK to give my node server free access to my database. This is the code of index.js in my functions folder: const functions = require("firebase-functions"); const admin = require("firebase-admin"); // Initialize…