0.1.0 • Published 2 years ago
medusa-storage-vercel v0.1.0
medusa-storage-vercel
Handle file uploads with vercel
Medusa Website | Medusa Repository
Features
- Upload files to
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:
npm install medusa-storage-vercel2. Set the following environment variables in .env:
BLOB_READ_WRITE_TOKEN=<vercel_blob_secret_xxxxxxxxxx....>
BUCKET_NAME=<bucket_name>3. In medusa-config.js add the following at the end of the plugins 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 start2. Try to change a product image.
Additional Resources
0.1.0
2 years ago