@sgftech/medusa-file-s3

1.2.4 • Public • Published

S3

Store uploaded files to your Medusa backend on S3.

Plugin Documentation | Medusa Website | Medusa Repository

Features

  • Store product images on S3
  • Support for importing and exporting data through CSV files, such as Products or Prices.
  • Support for Bucket Policies and User Permissions.

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

npm install medusa-file-s3

2. Set the following environment variables in .env:

S3_URL=<YOUR_BUCKET_URL>
S3_BUCKET=<YOUR_BUCKET_NAME>
S3_REGION=<YOUR_BUCKET_REGION>
S3_ACCESS_KEY_ID=<YOUR_ACCESS_KEY_ID>
S3_SECRET_ACCESS_KEY=<YOUR_SECRET_ACCESS_KEY>

3. In medusa-config.js add the following at the end of the plugins array:

const plugins = [
  // ...
  {
    resolve: `medusa-file-s3`,
    options: {
      s3_url: process.env.S3_URL,
      bucket: process.env.S3_BUCKET,
      region: process.env.S3_REGION,
      access_key_id: process.env.S3_ACCESS_KEY_ID,
      secret_access_key: process.env.S3_SECRET_ACCESS_KEY,
      aws_config_option: {},
    },
  },
]

Test the Plugin

1. Run the following command in the directory of the Medusa backend to run the backend:

npm run start

2. Upload an image for a product using the admin dashboard or using the Admin APIs.


Additional Resources

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.41latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.41
1.2.21
1.2.11
1.2.01
1.1.141
1.1.70
1.1.60
1.1.40
1.1.50

Package Sidebar

Install

npm i @sgftech/medusa-file-s3

Weekly Downloads

5

Version

1.2.4

License

MIT

Unpacked Size

20.4 kB

Total Files

5

Last publish

Collaborators

  • sgfgov