Category

Storage

Version

0.1.0

Last updated

Apr 27, 2024, 21:01:35 PM2 months ago

medusa-storage-vercel

Handle file uploads with vercel

Features

  • Upload files to Copy to clipboardassets/ (Only Support Public uploads).
  • 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-vercel
2. Set the following environment variables in Copy to clipboard.env:
BLOB_READ_WRITE_TOKEN=<vercel_blob_secret_xxxxxxxxxx....>
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-vercel`,
options: {
blobReadWriteToken: process.env.BLOB_READ_WRITE_TOKEN,
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.