Built by

tsvetann

Category

Storage

Version

0.0.3

Last updated

Jun 18, 2023, 07:35:54 AM3 months ago

Bunny.net

Store uploaded files to your Medusa backend on bunny.net CDN.

Features

  • Store product images on bunny.net

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:
npm install medusa-file-bunny
2. Set the following environment variables in
Copy to clipboard
.env
:
BUNNY_API_KEY=<YOUR_BUNNY_API_KEY>
BUNNY_STORAGE_ZONE_NAME=<BUNNY_STORAGE_ZONE_NAME>
BUNNY_STORAGE_PATH=<YOUR_BUNNY_STORAGE_PATH>
BUNNY_STORAGE_UPLOAD_ENDPOINT=<YOUR_BUNNY_STORAGE_UPLOAD_ENDPOINT>
BUNNY_PULLZONE_ENDPOINT=<YOUR_BUNNY_PULLZONE_ENDPOINT>
3. In
Copy to clipboard
medusa-config.js
add the following at the end of the
Copy to clipboard
plugins
array:
const plugins = [
// ...
{
resolve: "medusa-file-bunny",
options: {
storage: {
apiKey: process.env.BUNNY_API_KEY,
storageUploadEndPoint: process.env.BUNNY_STORAGE_UPLOAD_ENDPOINT,
storageZoneName: process.env.BUNNY_STORAGE_ZONE_NAME,
storagePath: process.env.BUNNY_STORAGE_PATH,
},
cdn: {
pullZoneEndPoint: process.env.BUNNY_PULLZONE_ENDPOINT,
},
},
},
]

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.

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.