medusa-file-r2
Cloudflare R2 storage plugin for Medusa. This plugin also supports CSV exports and imports. R2 is S3-compatible object storage service by Cloudflare and has a 10GB/month forever-free tier.
This plugin is written in Typescript and uses ESBuild to create the bundle and files needed to be included in the
file.Copy to clipboardmedusa.config.js
Getting Started
- Create a Cloudflare account: If you don't have one, you can create one here.
- Create a R2 bucket: Follow this guide to create a R2 bucket.
- Make the bucket public: Follow this guide to make the bucket public. While managed public access for your buckets through r2.dev cloudflare subdomain is relatively easy, it's preferred to use a custom domain as the managed r2.dev subdomain is rate-limited, custom domain also makes use of Cloudflare Cache to accelerate access to your R2 bucket.
- Obtain required credentials: You will need the following credentials to configure the plugin:
: Login to your Cloudflare account and go to theCopy to clipboardaccount_id
section. TheCopy to clipboardR2
is theCopy to clipboardaccount_id
in the top right corner.Copy to clipboardAccount ID
andCopy to clipboardaccess_key
Copy to clipboardsecret_key
- Follow this guide to generate Access Key ID and Secret Access Key for your R2 bucket.
: The name of the R2 bucket you created.Copy to clipboardbucket
: The public URL of the R2 bucket you created.Copy to clipboardpublic_url
- Install
plugin: Run the following command in your terminal:Copy to clipboardmedusa-file-r2
- Add the plugin to medusa.config.js: Add the following code to your medusa.config.js file:

Build your own plugins
Develop your own plugins with our API to speed up your processes.
Make your plugin available via npm for it to be shared in our Plugin Library with the broader Medusa community.
.png)