Medusa plugins
S

Strapi

Medusa plugin for Strapi as CMS

Need customizations for this plugin?

Get in touch
npm install @devx-commerce/strapi
Category
cms
Built by
devx-commerce
Type
unknown
Last updated
3 months ago
Monthly downloads
966

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 :
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:

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