1
votes

From this documentation, https://firebase.google.com/docs/storage/web/upload-files we can upload files to a bucket that is created and managed by Firebase (using the default App engine project managed by Firebase)

But how to use Firebase to use an existing storage bucket, that is NOT managed by Firebase (though it has admin access to the same Google cloud account as that used to create the Firebase app)?

1
To use the Google Cloud Storage Bucket other than the one used in firebase project, you'll have to enable Billing for your existing project.Parag Jadhav
@ParagJadhav I am already using the "blaze" plan and I have already enabled the billing.Vishwajeet Vatharkar
Did you find a solution for this?rmdan

1 Answers

3
votes

Initialize a dedicated instance of App using firebase.initializeApp(). You should be able to tell it the storage bucket you want to use when dealing with that app. Note that this is going to be separate from your default Firebase app, and you have to call it out every time you want to use it.

From the API docs linked above:

// Initialize another app
var otherApp = firebase.initializeApp({
  databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
  storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
}, "otherApp");

Then you should be able to access the storage for otherApp as suggested in firebase.storage():

firebase.storage(otherApp)