@devx-commerce/strapi

中文文档
2.0.0-beta.0发布于 2026/05/19MITESM + CJS零依赖近 30 天下载 2967

Medusa plugin for Strapi as CMS

原始使用文档
文档目录8 节
  1. Features
  2. Requirements
  3. Installation
  4. Setup
  5. Setting up Strapi
  6. Synchronizing data
  7. Usage
  8. Documentation

Medusa logo

Medusa Plugin - Strapi

Documentation | Website

A plugin for implementing Strapi as CMS for Medusa

Features

  • 🔄 Seamless integration between Medusa and Strapi
  • 📝 Flexible content management for your e-commerce store
  • 🖼️ Rich media management for product images and assets
  • 🚀 Extend product information with custom fields and content
  • 📱 Headless architecture for omnichannel commerce
  • 🔄 Automatic synchronization between Medusa and Strapi

Requirements

This plugin requires:

Installation

  1. Install the plugin:
npm install @devx-commerce/strapi @strapi/client
# or
yarn add @devx-commerce/strapi @strapi/client
  1. Add the plugin to your medusa-config.js:
const { defineConfig } = require("@medusajs/medusa"); // or "@medusajs/framework/utils"

module.exports = defineConfig({
  // ... other config
  plugins: [
    // ... other plugins,
    {
      resolve: "@devx-commerce/strapi",
      options: {
        base_url: process.env.STRAPI_URL,
        api_key: process.env.STRAPI_API_KEY,
      },
    },
  ],
});

Setup

Setting up Strapi

  1. Install Strapi if you haven't already:
npx create-strapi-app@latest my-strapi-cms
  1. Start your Strapi server:
cd my-strapi-cms
npm run develop
  1. Create an API token in Strapi:

    • Go to Settings > API Tokens
    • Create a new full access token
    • Copy the token to use in your Medusa configuration
  2. Create Product and Variant collections in Strapi:

    • In your Strapi admin panel, go to Content-Type Builder
    • Create a new collection type called Product
      • Add a title field (Text type)
      • Add a systemId field (Text type, Unique)
    • Create another collection type called Variant
      • Add a title field (Text type)
      • Add a systemId field (Text type, Unique)
    • Save and publish your new collection types
  3. Configure environment variables for your Medusa backend:

    STRAPI_URL=http://localhost:1337
    STRAPI_API_KEY=your-api-token-here
    

Synchronizing data

After installation and setup, the plugin will automatically:

  • Create and update products, collections & categories in Strapi when they are modified in Medusa
  • Sync product, collection & category metadata between Medusa and Strapi
  • Allow extending product data with Strapi's content types

Usage

Once the plugin is set up, you can use Strapi's admin panel to add rich content to your products and use the Strapi API to fetch this content for your storefront.

Example of fetching product content from Medusa (with Strapi fields):

// In your storefront
async function getProductContent(productId) {
  const response = await fetch(
    `${MEDUSA_BASE_URL}/store/products/${productId}?fields=cms_product.*`,
    {
      headers: {
        "x-publishable-api-key": STOREFRONT_PUBLISHABLE_API_KEY,
      },
    },
  );
  const data = await response.json();
  return data.data[0];
}

Documentation


版本与发布记录

@devx-commerce/strapi 共发布 41 个版本,首次发布于 2025/05/20;过去 12 个月发布了 1 个版本。

版本发布日期距今
2.0.0-beta.0latest2026/05/195 个月前
1.1.0-beta.3beta2025/10/101.1 年前
1.1.4-custom-jw-mayavecustom-jw-mayave2025/10/071.1 年前
0.0.122025/10/071.1 年前
1.1.3-custom-jw-mayave2025/10/061.1 年前
1.1.0-sync-options.2sync-options2025/09/301.1 年前

关于 @devx-commerce/strapi 的常见问题

@devx-commerce/strapi 是什么?

Medusa plugin for Strapi as CMS

如何安装 @devx-commerce/strapi?

在项目目录运行 npm install @devx-commerce/strapi,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:qs(^6.14.0)、@medusajs/ui(4.1.9)、@medusajs/cli(2.14.2)、@medusajs/icons(2.14.2)、@medusajs/medusa(2.14.2)、@medusajs/admin-sdk(2.14.2)、@medusajs/framework(2.14.2)、@medusajs/test-utils(2.14.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@devx-commerce/strapi 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/devx-commerce__strapi 是否存在。

@devx-commerce/strapi 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@devx-commerce/strapi 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@devx-commerce/strapi 可以商用吗?

@devx-commerce/strapi 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@devx-commerce/strapi 的下载量有多少?

根据 npm 官方下载统计,@devx-commerce/strapi 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,967 次,日均约 99 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@devx-commerce/strapi 还在维护吗?

最新版本 2.0.0-beta.0 发布于 2026/05/19(5 个月前);至今共发布 41 个版本,其中过去 12 个月发布了 1 个;首次发布于 2025/05/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。