The production-ready Medusa DTC Starter is outRead the announcement
F

File s3

S3 protocol file storage for Medusa. Supports any S3-compatible storage provider

Included in @medusajs/medusa, no separate install needed
Category
Built by
Version
2.22.4
Last updated
7 hours ago
Monthly downloads
Loading downloads

Medusa logo

@medusajs/file-s3

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

S3 File Module Provider for Medusa: stores uploaded files in Amazon S3 or any S3-compatible storage, such as MinIO, DigitalOcean Spaces, Cloudflare R2, or Supabase Storage. Use it for file storage in production. It ships with and is registered through the path.

At a glance

Package
TypeModule Provider (File Module)
Provider ID
Registered by defaultNo (on Medusa Cloud, yes, with and IAM role authentication)
Import from

Features

  • Public and private file uploads, with presigned download and upload URLs.
  • Access key or IAM role authentication.
  • Custom endpoints for S3-compatible storage.
  • Configurable object ACLs, including disabling ACLs for buckets with Object Ownership set to "Bucket owner enforced".

Installation

No installation needed. The provider is a dependency of .

Usage

Register the provider in the File Module's array in . The File Module accepts exactly one provider, so this replaces the default local provider.

Configuration

OptionTypeDescriptionDefault
Required. Base URL used to build public file URLs.-
Required. The bucket's region.-
Required. The bucket name.-
How to authenticate. With , the AWS SDK's default credentials chain is used.
Access key ID. Required when is .-
Secret access key. Required when is .-
Session token for temporary credentials.-
Prefix (folder path) added to uploaded file keys.
Custom endpoint URL for S3-compatible storage.-
header set on uploaded objects.
Validity of presigned download URLs, in seconds.
Extra options passed to the S3 client.
ACL set on uploaded objects. omits the ACL header. for public files, for private files
Environment variableDescription
, , , , , Values for the matching options, as used in the example above.
, , , , Read by to configure the default provider on Medusa Cloud.

Resources