medusa-storage-vercel

0.1.0 • Public • Published

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


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 .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 start

2. Try to change a product image.


Additional Resources

Package Sidebar

Install

npm i medusa-storage-vercel

Weekly Downloads

7

Version

0.1.0

License

GPL-3.0-only

Unpacked Size

45.7 kB

Total Files

10

Last publish

Collaborators

  • hadisdev