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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@strapi-community/shopify

v1.0.0

Published

Official Strapi Shopify Plugin

Readme


A powerful Strapi plugin that seamlessly connects your Strapi application with Shopify stores through a user-friendly interface. It features a custom Shopify Product field, robust webhook management, and efficient product synchronization capabilities. The plugin comes with built-in content types for store management, along with configurable caching mechanisms to optimize performance.

📋 Table of Contents

✨ Features

  • Manage multiple Shopify shops within Strapi
  • Handle Shopify webhooks for products
  • Custom field for Shopify products
  • Flexible cache engine: in-memory (LRU) or Redis
  • Automatically attaches Shopify product data to Strapi content type responses (when a content type uses the custom Shopify product field)

📋 Requirements

  • Strapi v5.7.0 or later
  • Node.js 18+
  • For Redis cache: a running Redis instance

📦 Installation

npm install @strapi-community/shopify@latest
# or
yarn add @strapi-community/shopify@latest

⚙️ Configuring Shopify for shopify (Step-by-Step with Images)

Follow these steps to configure your Shopify store and connect it to your Strapi instance using this plugin. Visual guidance is provided with embedded images for each step.

1. Open Your Shopify Store

Shopify Store

  • Log in to your Shopify admin dashboard.

2. Go to Store Settings

Store Settings

  • In the Shopify admin sidebar, click on Settings to access your store settings.

3. Create a Custom App

Create Custom App 1 Create Custom App 2

  • Navigate to Apps in the sidebar.
  • Click Develop apps for your store (you may need to enable this if not already done).
  • Click Create an app and provide a name for your custom app.

4. Configure the Custom App

Custom App Config

  • In your new app, go to the Configuration tab.
  • Set up the required Admin API scopes for your integration (see next step).

5. Set API Scopes

Custom App Scopes

  • Grant the necessary permissions (scopes) for products.

6. Set API Version

Custom App API Version

  • Select the appropriate Shopify API version for your app.

7. Get API Credentials

Custom App Credentials

  • Go to the API credentials tab.
  • Copy the Admin API access token and API key. You will need these for the Strapi plugin configuration.

8. Install the Custom App

Install Custom App

  • Click Install app to add the custom app to your Shopify store.

9. Retrieve Admin Access Token

Admin Access Token 1 Admin Access Token 2

  • After installation, you can view and copy your Admin API access token.

10. Configure the Plugin in Strapi

Plugin configuration

  • Use the credentials and settings from the previous steps to fill out the Shopify Shop configuration in Strapi (see the earlier 'Configuration' section in this README).
  • Example fields:
    • address: Your Shopify store address (e.g., your-store.myshopify.com)
    • apiSecretKey: The API secret key from your Shopify app
    • adminApiAccessToken: The Admin API access token
    • apiKey: The API key

Note:

  • Make sure to set up webhooks in Shopify to point to your Strapi instance's webhook endpoint (/api/shopify/webhooks).
  • Refer to the images for each step to ensure correct configuration.

🔧 Configuration (@config)

The plugin requires a configuration object. You must provide a host (publicly accessible URL of your Strapi instance) and select a cache engine (memory or redis).

Schema

{
  host: string (URL), // required
  engine: 'memory' | 'redis', // required
  encryptionKey: string (32 chars), // required
  // If engine is 'redis', provide connection details:
  connection?: {
    host: string, // required for redis
    port: number, // required for redis
    db: number,   // required for redis
    password?: string,
    username?: string
  }
}

Example (Memory Engine)

module.exports = {
  'shopify': {
    host: 'https://your-strapi-instance.com',
    encryptionKey: 'random 32 chars string',
    engine: 'memory',
  },
};

Example (Redis Engine)

module.exports = {
  'shopify': {
    host: 'https://your-strapi-instance.com',
    encryptionKey: 'random 32 chars string',
    engine: 'redis',
    connection: {
      host: 'localhost',
      port: 6379,
      db: 0,
      password: 'yourpassword', // optional
      username: 'youruser',     // optional
    },
  },
};

📝 Config

Shopify Shop

  • vendor (string, required)
  • address (string, required)
  • apiSecretKey (string, required) Used to validate incoming Shopify webhook signatures. Only requests signed with this key are accepted.
  • isActive (boolean, required, default: true)
  • adminApiAccessToken (string, required)
  • apiKey (string)
  • webhooks (relation to webhooks)

Shopify Webhook

  • topic (enum: ProductsCreate, ProductsUpdate, ProductsDelete, OrdersCreate, OrdersUpdated, OrdersDelete)
  • shopifyId (string)
  • format (enum: Json)
  • callbackUrl (string)
  • errors (json)
  • shop (relation to shop)
  • service (string, required)
  • method (string, required)

Shopify Product Attachment

When a Strapi content type includes the custom Shopify product field, the plugin will automatically attach the corresponding Shopify product data to API responses for that content type. This is handled transparently in the plugin's middleware during the findOne and findMany actions.

  • Supported queries:

    • findOne (single record fetch)
    • findMany (list fetch, including collection endpoints)
    • Both REST and GraphQL APIs are supported if routed through Strapi's standard controllers.
  • Caching:

    • Product data retrieval supports caching to improve performance and reduce Shopify API calls.
    • The cache engine is configurable via the plugin config (engine: 'memory' | 'redis').
    • See the Configuration section for details on setting up memory or Redis caching.
    • Cached product data is used when available; otherwise, fresh data is fetched from Shopify and stored in the cache.

Reference: See server/src/register.ts, middleware in the strapi.documents.use block for details on how product data is attached to responses.

🔄 Webhook Endpoint

The plugin exposes a webhook endpoint for Shopify:

POST /api/shopify/webhooks
  • No authentication required
  • Handles product events from Shopify
  • Security: Every incoming webhook request is validated using the shop's apiSecretKey (HMAC signature) via Shopify's official SDK. Only requests with a valid signature are processed; all others are rejected.

🔒 Middleware Configuration for Raw Request Body

For the plugin to work correctly—especially in verifying incoming Shopify webhook signatures—it is required to have access to the raw (unparsed) request body. This is achieved by configuring Strapi's body parser middleware to include the unparsed body.

To do so, update your application's middleware configuration in apps/example-app/config/middlewares.ts as follows:

{
  name: 'strapi::body',
  config: {
    includeUnparsed: true,
  },
}

This setting leverages the Koa Body parser's includeUnparsed option. For more details, please refer to the Strapi V5 documentation and the koa-body parser documentation.

👨‍💻 Development & Testing

  • Build: yarn build
  • Test backend: yarn test:server
  • Test frontend: yarn test:ts:front

🔗 Links

💬 Community support

  • GitHub (Bug reports, contributions)

You can also used official support platform of Strapi, and search [VirtusLab] prefixed people (maintainers)

📄 License

See the MIT License file for licensing information.