Use your Shopify data within Strapi
Use your Shopify products in Strapi!
The Shopify Fields plugin currently implements the following custom fields:
The Shopify Fields plugin is only compatible with Strapi v4.
# if you use NPM
npm install strapi-plugin-shopify-fields
# if you use Yarn
yarn add strapi-plugin-shopify-fields
To use the Shopify Fields plugin, you must create a private app on Shopify and obtain an access token. To do so, you should:
read_products
under the Products category.env
fileOpen or create the file config/plugins.js
and enable the plugin by adding the following snippet:
1
2
3
4
5
6
7
8
9
10
11
module.exports = {
// ...
'shopify-fields': {
enabled: true,
config: {
apiVersion: '2022-07', // Or one of Shopify's supported API versions
accessToken: process.env.SHOPIFY_ACCESS_TOKEN, // The environment variable containing your private app's access token
shopName: process.env.SHOP_NAME, // The environment variable containing your myshopify.com domain
},
},
};
Open the file config/middlewares.js
and check the configuration of the strapi::security
middleware.
If your file looks like this:
1
2
3
4
5
module.exports = [
'strapi::errors',
'strapi::security',
'strapi::cors',
'strapi::poweredBy',
Replace 'strapi::security'
with:
1
2
3
4
5
6
7
8
9
10
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
directives: {
'img-src': ["'self'", 'data:', 'blob:', 'https://dl.airtable.com', 'https://cdn.shopify.com'],
},
},
},
}
If, instead, your file already presents strapi::security
as an object, simply add https://cdn.shopify.com
to the img-src
array.
npm install strapi-plugin-shopify-fields
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.