Cloud Function To Export Firestore Backup Data. Using Firebase-admin Or @google-cloud/firestore?
Answer : The way you're accessing the admin client is correct as far as I can tell. const client = new admin.firestore.v1.FirestoreAdminClient({}); However, you probably won't get any TypeScript/intellisense help beyond this point since the Firestore library does not actually define detailed typings for v1 RPCs. Notice how they are declared with any types: https://github.com/googleapis/nodejs-firestore/blob/425bf3d3f5ecab66fcecf5373e8dd03b73bb46ad/types/firestore.d.ts#L1354-L1364 Here is an implementation I'm using that allows you to do whatever operations you need to do, based on the template provided by firebase here https://firebase.google.com/docs/firestore/solutions/schedule-export In my case I'm filtering out collections from firestore I don't want the scheduler to automatically backup const { Firestore } = require('@google-cloud/firestore') const firestore = new Firestore() const client = new Firestore.v1.FirestoreAdminClient() const bu...