npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-plugin-shopify-fields

v4.0.0-beta4

Published

Use your Shopify data within Strapi

Downloads

48

Readme

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:

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
    },
  },
};

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:

module.exports = [
  'strapi::errors',
  'strapi::security',
  'strapi::cors',
  'strapi::poweredBy',

Replace 'strapi::security' with:

{
  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.

🚀 Roadmap

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