medusa-storage-vercel
Handle file uploads with vercel
Features
- Upload files to Copy to clipboard
assets/
(Only Support Public uploads). - Get file signed url
- Delete file
Prerequisites
- Node.js v17 or greater
- A Medusa backend
- Vercel Blob Storage Setup
- Vercel storage bucket.
How to Install
1. Run the following command in the directory of the Medusa backend:
1npm install medusa-storage-vercel
2. Set the following environment variables in Copy to clipboard
.env
:12BLOB_READ_WRITE_TOKEN=<vercel_blob_secret_xxxxxxxxxx....>BUCKET_NAME=<bucket_name>
3. In Copy to clipboard
medusa-config.js
add the following at the end of the Copy to clipboardplugins
array:12345678910const 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:
1npm start
2. Try to change a product image.