F
File s3
S3 protocol file storage for Medusa. Supports any S3-compatible storage provider
@medusajs/file-s3
Documentation | Website
Building blocks for digital commerce
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 | |
| Type | Module Provider (File Module) |
| Provider ID | |
| Registered by default | No (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
| Option | Type | Description | Default |
|---|---|---|---|
| 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 variable | Description |
|---|---|
| , , , , , | Values for the matching options, as used in the example above. |
| , , , , | Read by to configure the default provider on Medusa Cloud. |

