npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

strapi-provider-upload-firebase-storage

v1.0.0

Published

Firebase Storage provider for Strapi Media Library Uploads

Downloads

36

Readme

Firebase Storage Media Library Provider for Strapi

The best Strapi Media Library provider for Firebase Storage 🔥 Supports custom Firebase Storage buckets for Spark plan users.

📝 Table of Contents

Getting Started

To install the package, you can either use npm or yarn

npm i strapi-provider-upload-firebase-storage

# or

yarn add strapi-provider-upload-firebase-storage

Then, you need to add a plugin config in order to use strapi-provider-upload-firebase-storage.

Example

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    provider: "firebase-storage",
    providerOptions: {
      serviceAccount: require("./SERVICE_ACCOUNT_KEY_PATH.json"),
      bucketUrl: env("STORAGE_BUCKET_URL"),
      uploadOptions: {},
      deleteOptions: {},
    },
  },
  // ...
});

There are two environment variables you need to create in your .env.

Example

.env

STORAGE_BUCKET_URL=<PROJECT_NAME>.appspot.com

| Environment Variables | Description | | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------ | | STORAGE_BUCKET_URL | The name of your Firebase storage bucket. E.g. gs://<PROJECT_NAME>.appspot.com but omit the gs:// when entering it in your .env |

⚠ Important Note! You should add your service account key (.json file) in your .gitignore to prevent it from being pushed to your repository!

That is all it takes to upload your images to Firebase storage via Strapi! 🎊

If you need help finding your service account key or bucket name, refer to the FAQ section below.

Configurations

The initialization configuration is passed down to the provider via the options parameter. (e.g: admin.initializeApp()). You can see the complete list of options here.

There are a few additional configurations that you can pass into the provider. You can view all the optional upload options here and delete options here.

Example

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    provider: "firebase-storage",
    providerOptions: {
      serviceAccount: require("./SERVICE_ACCOUNT_KEY_PATH.json"),
      bucketUrl: env("STORAGE_BUCKET_URL"),
      options: {},
      customBucket: "my-custom-bucket",
      debug: true,
      uploadOptions: {
        resumable: false,
        private: true,
      },
      deleteOptions: {},
    },
  },
  // ...
});

By default, all uploads are set to public. You can however change those by passing in the options into the uploadOptions object. Below is an example of additional options you can pass in.

| Optional Parameters | Type | Default Value | Possible Values | | :------------------ | :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------- | | debug | boolean | false | true / false | | options | object | {} | Refer to official documentation | | customBucket | string | undefined | <BUCKET_NAME> Only applicable if you use the Spark plan & created a custom bucket | | uploadOptions | object | {} | Refer to official documentation | | deleteOptions | object | {} | Refer to official documentation |

Status

npm version CI Coverage Status Dependencies

FAQ Section

  • The service account key can be created by going to your Firebase console → Project settings → Service account → Click "Generate new private key". Then save that file anywhere safe. If saving in your repo, remember to add it into .gitignore!
  • Go to your Firebase console → Project settings → Storage → Click "Get Started" (if its your first time setting up Firebase Storage for the project) → Copy the URL that looks like gs://<PROJECT_NAME>.appspot.com omitting the prefixed gs://.
  • The file path is relative to your ./config/plugins.js. So if your .env is in the root of your repo (it usually is), your path will be ../<SERVICE_ACCOUNT_KEY_NAME>.json

Contributions

Contributions & suggestions are welcome! Please do test it out and let me know what additional features are missing or needed. Also do let me know about any bugs you find! 😉