I'm currently working on extracting the data from a JSON file stored in my Firebase in order to utilize it for searching within my Google action. So far, I have managed to retrieve the file, but I'm unsure of which method to employ next. I am looking for something akin to a toString() method to transfer the contents of the JSON file into my action.
After scouring through , I am contemplating whether to use get() or createReadStream(), however, there isn't enough information available to determine the best course of action.
const { conversation } = require('@assistant/conversation');
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const defaultApp = admin.initializeApp({
credential: admin.credential.applicationDefault()
});
const database = admin.firestore();
var storage = defaultApp.storage();
const bucket = storage.bucket('gs://NAME_OF_BUCKET.appspot.com');
const jsonFile = bucket.file('FILE_NAME.json');
I would greatly appreciate any assistance as I've been diligently searching for a solution without luck so far! Thank you!