1.0.4 • Published 10 months ago

medusa-file-sanity v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

medusa-file-sanity

Store uploaded files to your Medusa backend on Sanity.

Features

  • Store product images on Sanity CMS

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

yarn add medusa-file-sanity

2. Set the following environment variables in .env:

SANITY_PROJECT_ID=some-project-id
SANITY_DATASET=production
SANITY_TOKEN=some-token

3. In medusa-config.js add the following at the end of the plugins array:

const plugins = [
	// ...
	{
		resolve: `medusa-file-sanity`,
		options: {
			projectId: process.env.SANITY_PROJECT_ID,
			dataset: process.env.SANITY_DATASET,
			token: process.env.SANITY_TOKEN,
			apiVersion: '2021-10-21',
			useCdn: false, // `false` if you want to ensure fresh data
		},
	},
]

Test the Plugin

1. Run the following command in the directory of the Medusa backend to run the backend:

yarn start

2. Upload an image for a product using the admin dashboard or using the Admin APIs.

1.0.4

10 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago