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
1 answer

Firestore admin pagination without parameters (Node.js)

I would like to paginate through all of the documents in one of my collections. However I don't need a search parameter like 'population' or any other one. I simply want to load all items in the collection in batches, in no particular order. The…
Tyler Rutt
  • 567
  • 2
  • 8
  • 24
0
votes
1 answer

Firebase: Get list of users subscribed to a topic

Is there a way to, using the Firebase Admin SDK for Java, get a list of all registration tokens that are subscribed to a given topic? If not, is there a way to get that information using the REST API?
nixin72
  • 322
  • 4
  • 16
0
votes
1 answer

firebase cloud function transaction Cannot set property

i have a cloud firebase function. I want to match users here. but when I want to update the new user list in transaction. Everything works fine until I get to the transaction. it just gives a problem in the update process I get an error. where did i…
0
votes
0 answers

How do you correctly configure firebase-admin for both server and client side so that you can both deploy Cloud functions (Trigger Email) and signup

I am running into this error, when I try to register users on my local server: firebase-admin appears to have been installed in an unsupported environment. This package should only be used in server-side or backend Node.js environments, and should…
JJJ JJJ
  • 11
  • 1
0
votes
1 answer

Node typescript: type 'string | string[]' is not assignable to type 'string'

This should be an easy one yet I cant figure it out at all. I am using firebase to try to verify a token form client side const isAuthenticated = async (req: Request, res: Response, next: NextFunction) => { try { let token: string; …
0
votes
0 answers

Error: Firebase ID token has no "kid" claim

Firebase documentation states that custom claims can be accessed like so: admin .auth() .verifyIdToken(idToken) .then((claims) => { if (claims.admin === true) { // Allow access to requested admin resource. } }); I have…
artooras
  • 6,315
  • 9
  • 45
  • 78
0
votes
1 answer

Firebase functions.pubsub.schedule not reading database

I'm trying to schedule a daily execution of a firebase function, but I can't access the data from the database. I can access it using functions.database, but not in functions.pubsub.schedule. const functions = require('firebase-functions'); var…
0
votes
0 answers

Unable to store gzip file in google storage

I would like to store json file in google storage. To save storage and network bandwidth, the file is compressed in gzip format and upload to my bucket, and set Caches-Control: no-transform to prevent Transcoding. The problem is the file stored in…
0
votes
2 answers

java.lang.NoSuchMethodError when initialising firebase through admin SDK Java

I am trying to connect to firestore through the firebase admin SDK. However, when I call: FirebaseOptions options = new FirebaseOptions.Builder() .setCredentials(GoogleCredentials.fromStream(serviceAccount)) .build(); …
Aryan
  • 136
  • 1
  • 3
  • 17
0
votes
2 answers

firebase cloud functions invoke callback

I'm using firebase admin SDK to create new User to my web app. // function to create user and store additional info in firestore exports.createUser = functions .https.onCall((data, context) => { admin.auth().createUser({ …
0
votes
0 answers

JSONP callback doesn't seem to be working

I've been working with the Firebase Admin SDK for Nodejs in the cloud functions to create custom auth tokens using Spotify and Firebase auth. I've been trying to use the example given by Google that goes as follows: exports.token =…
0
votes
1 answer

Firebase Firestore not returning documents

I was attempting to fetch all documents from a collection in a Node.js environment. The documentation advises the following: import * as admin from "firebase-admin"; const db = admin.firestore(); const citiesRef = db.collection('cities'); const…
0
votes
1 answer

Uncaught (in promise) TypeError: Cannot read property 'httpsCallable' of undefined (Firebase functions issue)

I'm going through the docs, and I cannot see where I'm going wrong. Can somebody maybe shed some light? I think I'm not referencing functions() or firebase correctly. Thanks! Here's all of the code: firebase.js import firebase from…
Joel Hager
  • 2,990
  • 3
  • 15
  • 44
0
votes
1 answer

Firebase Auth with admin sdk?

I am using firebase firestore as datastore for my web based application. The application has 2 different actors. Supervisor: logs in via a common password set for all supervisors plus the ability to generate unique codes. User: logs in via the…
0
votes
0 answers

Firebase-admin : Query data as user from firestore

The end goal here is to validate from an external server that a user can query a given document according to the Firestore rules in place. What I would like to achieve is along the lines of const idToken = request.headers.idToken; const…
1 2 3
99
100