0.1.0 • Published 1 year ago

medusa-storage-vercel v0.1.0

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
1 year ago

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