npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@medusajs/file-s3

v2.22.4

Published

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

Readme

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 @medusajs/medusa and is registered through the @medusajs/medusa/file-s3 path.

At a glance

| | | | --- | --- | | Package | @medusajs/file-s3 | | Type | Module Provider (File Module) | | Provider ID | s3 | | Registered by default | No (on Medusa Cloud, yes, with id: "s3" and IAM role authentication) | | Import from | @medusajs/medusa/file-s3 |

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 @medusajs/medusa.

Usage

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

import { defineConfig } from "@medusajs/framework/utils"

module.exports = defineConfig({
  // ...
  modules: [
    {
      resolve: "@medusajs/medusa/file",
      options: {
        providers: [
          {
            resolve: "@medusajs/medusa/file-s3",
            id: "s3",
            options: {
              file_url: process.env.S3_FILE_URL,
              access_key_id: process.env.S3_ACCESS_KEY_ID,
              secret_access_key: process.env.S3_SECRET_ACCESS_KEY,
              region: process.env.S3_REGION,
              bucket: process.env.S3_BUCKET,
              endpoint: process.env.S3_ENDPOINT,
            },
          },
        ],
      },
    },
  ],
})

Configuration

| Option | Type | Description | Default | | --- | --- | --- | --- | | file_url | string | Required. Base URL used to build public file URLs. | - | | region | string | Required. The bucket's region. | - | | bucket | string | Required. The bucket name. | - | | authentication_method | "access-key" \| "s3-iam-role" | How to authenticate. With s3-iam-role, the AWS SDK's default credentials chain is used. | "access-key" | | access_key_id | string | Access key ID. Required when authentication_method is "access-key". | - | | secret_access_key | string | Secret access key. Required when authentication_method is "access-key". | - | | session_token | string | Session token for temporary credentials. | - | | prefix | string | Prefix (folder path) added to uploaded file keys. | "" | | endpoint | string | Custom endpoint URL for S3-compatible storage. | - | | cache_control | string | Cache-Control header set on uploaded objects. | "public, max-age=31536000" | | download_file_duration | number | Validity of presigned download URLs, in seconds. | 3600 | | additional_client_config | Record<string, any> | Extra options passed to the S3 client. | {} | | acl | "public-read" \| "private" \| "authenticated-read" \| "bucket-owner-full-control" \| false | ACL set on uploaded objects. false omits the ACL header. | "public-read" for public files, "private" for private files |

| Environment variable | Description | | --- | --- | | S3_FILE_URL, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_REGION, S3_BUCKET, S3_ENDPOINT | Values for the matching options, as used in the example above. | | S3_FILE_URL, S3_PREFIX, S3_REGION, S3_BUCKET, S3_ENDPOINT | Read by defineConfig to configure the default provider on Medusa Cloud. |

Resources