DEV Community

Jake Ngatchu
Jake Ngatchu

Posted on

Supercharging Medusa v2 with Supabase Storage

Alright, developers—let’s talk file storage. Medusa v2 is an awesome headless commerce engine, but if you need a place to store your product images, user uploads, or any other files, you need a solid storage solution. AWS S3? Great, but it can get expensive fast. Firebase? Locked into Google’s ecosystem. Enter Supabase Storage—the perfect mix of free (yes, free!), scalable, and easy to use.

I built medusav2-file-supabase-storage because we’re on a mission: helping startups and businesses get their Medusa stores running for the lowest possible cost while making sure they stay scalable. If you’re just starting out, every dollar counts, and this plugin lets you save money now without setting yourself up for failure later.

What This Plugin Does

Uploads files straight to a Supabase storage bucket.

Gets public URLs for those files (because sharing is caring).

Deletes files when you don’t need them anymore.

Uses Supabase’s Storage API, making everything smooth and simple.

Installation (Super Easy)

Just run:

npm install medusav2-file-supabase-storage

Setting It Up in Medusa

Add this to your Medusa config under modules:

modules: [
    {
        resolve: "@medusajs/medusa/file",
        options: {
            providers: [
                {
                    resolve: `medusav2-file-supabase-storage/modules/file`,
                    options: {
                        bucketName: process.env.BUCKET_NAME,
                        supabaseUrl: process.env.SUPABASE_URL,
                        apiKey: process.env.SUPABASE_KEY,
                    },
                },
            ],
        },
    }
],
Enter fullscreen mode Exit fullscreen mode

How to Use It

Upload a File

Once it’s set up, Medusa will automatically use Supabase for file storage when handling uploads. No extra steps needed!

Delete a File

If you need to remove a file, Medusa will handle deletion requests through the configured provider.

Why This is Good for You!

It’s Free: Supabase gives you a generous free tier. No surprise bills!

It Scales: Your store grows? Supabase grows with you.

Lower Startup Costs: Spend less on infrastructure and more on building your business.

Smooth Integration: Works seamlessly with Medusa v2, no hacks required.

Contribute & Customize

Want to tweak it? Go for it:

Clone the repo.

Install dependencies.

$ yarn install
Enter fullscreen mode Exit fullscreen mode

Add whatever features you need.

Final Thoughts

If you’re using Medusa v2 and don’t want to overcomplicate file storage (or waste money), medusav2-file-supabase-storage is the way to go. It’s free, simple, and built for growth. Get started today and keep your infrastructure costs low while keeping things future-proof. 🚀

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay