Built by

RE-yura

Category

Other

Version

0.0.3

Last updated

Oct 30, 2023, 18:41:06 PMa month ago

medusa-file-gcs

Features

  • Store product images on Google Cloud Storage.
  • Support for importing and exporting data through CSV files, such as Products or Prices.
  • Support for both private and public buckets.

How to Install

1. Run the following command in the directory of the Medusa backend:
npm install @reyura/medusa-file-gcs
2. Set the following environment variables in
Copy to clipboard
.env
:
GCS_PROJECT_ID=<GCS_PROJECT_ID>
GCS_BUCKET=<GCS_BUCKET>
GCS_PRIVATE_BUCKET=<GCS_PRIVATE_BUCKET>
GCS_EMAIL=<GCS_EMAIL>
GCS_PRIVATE_KEY=<GCS_PRIVATE_KEY>
GCS_PRIVATE_EMAIL=<GCS_PRIVATE_EMAIL>
GCS_PRIVATE_PRIVATE_KEY=<GCS_PRIVATE_PRIVATE_KEY>
3. In
Copy to clipboard
medusa-config.js
add the following at the end of the
Copy to clipboard
plugins
array:
const plugins = [
// ...
{
resolve: `@reyura/medusa-file-gcs`,
options: {
projectId: process.env.GCS_PROJECT_ID,
bucketName: process.env.GCS_BUCKET,
privatebucketName: process.env.GCS_PRIVATE_BUCKET,
email: process.env.GCS_EMAIL,
privateKey: process.env.GCS_PRIVATE_KEY.replace(/\\n/g, "\n"),
privateEmail: process.env.GCS_PRIVATE_EMAIL,
privatePrivateKey: process.env.GCS_PRIVATE_PRIVATE_KEY.replace(/\\n/g, "\n"),
},
},
]

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.