I'm being passed a URL to a Firebase storage file in Cloud Functions, and need to take that URL and get a base64 string from it.
I was using request is taking too long and causing errors, so I'd rather parse the URL, get the file in Firebase storage, and get the base64 string from there.
I tried using admin.storage() but cannot .refFromURL() from there, or fetch the file. It is in nested subdirectories, which I can provide during parsing the URL.
How can I do this?
const passedURL = 'https://{FIREBASESTORAGEPROJECT}.googleapis.com/v0/b/{BUCKET}.appspot.com/o/{FOLDER_NAME_1}/{FOLDER_NAME_2}/{DOCUMENT_NAME}.{EXT}'
admin.storage().refFromURL(passedURL) // not a function