Strapi plugin logo for Shopify Fields

Shopify Fields

Use your Shopify data within Strapi

thumbnail for Shopify Fields

Strapi's Shopify Fields Plugin

Use your Shopify products in Strapi!

🖌️ Available custom fields

The Shopify Fields plugin currently implements the following custom fields:

  • Single Product
  • Multiple Products

✨ Supported Strapi Versions

The Shopify Fields plugin is only compatible with Strapi v4.

⚙️ Installation

# if you use NPM
npm install strapi-plugin-shopify-fields

# if you use Yarn
yarn add strapi-plugin-shopify-fields

🔧 Configuration

Creating a private app on Shopify

To use the Shopify Fields plugin, you must create a private app on Shopify and obtain an access token. To do so, you should:

  1. Open your Shopify store's admin dashboard
  2. Click on Apps
  3. Click on Apps and sales channel settings
  4. Click on Develop apps for your store
  5. Click on Create an app
  6. Insert a name for the app in the App name field, eg. Strapi
  7. Click on Create app
  8. Click on Configure Admin API scopes
  9. Check read_products under the Products category
  10. Click on Save
  11. Go to the API credentials tab
  12. Click on Install app
  13. Copy your access token and store it in your .env file

Configuring the plugin

Open or create the file config/plugins.js and enable the plugin by adding the following snippet:

1module.exports = {
2  // ...
3  'shopify-fields': {
4    enabled: true,
5    config: {
6      apiVersion: '2022-07', // Or one of Shopify's supported API versions
7      accessToken: process.env.SHOPIFY_ACCESS_TOKEN, // The environment variable containing your private app's access token
8      shopName: process.env.SHOP_NAME, // The environment variable containing your myshopify.com domain
9    },
10  },
11};

Configuring the security middleware

Open the file config/middlewares.js and check the configuration of the strapi::security middleware.

If your file looks like this:

1module.exports = [
2  'strapi::errors',
3  'strapi::security',
4  'strapi::cors',
5  'strapi::poweredBy',

Replace 'strapi::security' with:

1{
2  name: 'strapi::security',
3  config: {
4    contentSecurityPolicy: {
5      directives: {
6        'img-src': ["'self'", 'data:', 'blob:', 'https://dl.airtable.com', 'https://cdn.shopify.com'],
7      },
8    },
9  },
10}

If, instead, your file already presents strapi::security as an object, simply add https://cdn.shopify.com to the img-src array.

🚀 Roadmap

  • Automatic sync between your Shopify catalog and Strapi fields
  • Improved UI
  • Support for collections and metafields

Install now

npm install strapi-plugin-shopify-fields

STATS

9 GitHub stars16 weekly downloads

Last updated

785 days ago

Strapi Version

4.4.0 and above

Author

github profile image for @WalkingPizza
@WalkingPizza

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.