Setting up tests for cleaning up local Firebase Emulator environment and need to clear all buckets. For Gcloud implementation there’s a method but can’t find equivalent for Firebase Storage. I’ve tried to cast as Storage
from @google-cloud/storage
but that doesn’t work. Any workaround?
2
Answers
Thanks for the push in the right direction, Frank. I'm using server-side Firebase SDKs for NodeJS.
Below did work:
As
getBuckets()
doesn't exist on Firebase'sStorage
object, returned fromgetStorage()
, below didn't work:The client-side Firebase SDKs only know about a single bucket, and have now way to list all buckets in a project.
The server-side Firebase SDKs for Cloud Storage are mostly simple wrappers around the GCP SDKs for their platforms, so should give you access to all APIs that those have. If you can’t get that to work, edit your question to show what you tried (which would also answer the question of what language you’re using).