GithubHelp home page GithubHelp logo

siroyai / strapi-plugin-shopify-fields Goto Github PK

View Code? Open in Web Editor NEW

This project forked from walkingpizza/strapi-plugin-shopify-fields

0.0 0.0 0.0 111 KB

Upgraded to node v20

JavaScript 100.00%

strapi-plugin-shopify-fields's Introduction

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

strapi-plugin-shopify-fields's People

Contributors

walkingpizza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.