Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

How to upload media to Firebase Storage?

default discord avatar
tasin_adl9 months ago
1


Can you please help me?


I was able to upload images to the firebase storage.



But if I try to retreive them /api/media/file/filename.jpg. I get the following error




But if I login to the payload cms on the same browser, it starts to work. What am I doing wrong.

  • default discord avatar
    luca.dasic12 months ago

    I found the solution. Firebase Storage is built on top of Google Cloud Storage so you can just use the GCS Adapter that is already available in the plugin.



    adapter: gcsAdapter({
                bucket: [URL_YOU_CAN_FIND_ON_FIREBASE_STORAGE_PAGE_WITHOUT_gs://],
                options: {
                  keyFilename: [PATH_TO_firebaseServiceAccount.json]
                },
              }),


    Hi guys I've been wrapping my head over this. I tried creating my own adapter based off the S3 adapter in

    @payloadcms/plugin-cloud-storage

    but no luck. I changed everything to Firebase Storage but I get a webpack error.



    I think I'm missing something and probably if someone here had an example of a properly made custom adapter it would make things clearer

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.