Built by

Bernix01

Category

Storage

Version

0.1.7

Last updated

Feb 14, 2024, 19:45:10 PM5 months ago

medusa-storage-supabase

Handle file uploads with supabase

Features

  • Upload files to Copy to clipboardassets/ and private files to Copy to clipboardprivate/.
  • Get file signed url
  • Delete file

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:
npm install medusa-storage-supabase
2. Set the following environment variables in Copy to clipboard.env:
STORAGE_BUCKET_REF=<found in the settings>
STORAGE_SERVICE_KEY=<this is the service role key, not the public>
BUCKET_NAME=<bucket name>
3. In Copy to clipboardmedusa-config.js add the following at the end of the Copy to clipboardplugins array:
const plugins = [
// ...
{
resolve: `medusa-storage-supabase`,
options: {
referenceID: process.env.STORAGE_BUCKET_REF,
serviceKey: process.env.STORAGE_SERVICE_KEY,
bucketName: process.env.BUCKET_NAME,
},
},
];

Test the Plugin

1. Run the following command in the directory of the Medusa backend to run the backend:
npm start
2. Try to change a product image.

Additional Resources

Build your own plugins

Develop your own plugins with our API to speed up your processes.

Make your plugin available via npm for it to be shared in our Plugin Library with the broader Medusa community.