Back to Plugins

Strapi CMS Integration

Integrate Strapi headless CMS with your Medusa store for powerful content management capabilities.


Overview

This plugin connects Medusa with Strapi, enabling you to manage your e-commerce content through Strapi’s intuitive interface. Strapi is a leading open-source headless CMS that provides flexible content modeling and a user-friendly admin panel.

Features

Requirements

Installation

Install the plugin using npm:

npm install @devx-commerce/strapi

Configuration

Step 1: Set Up Strapi

If you don’t have Strapi installed:

npx create-strapi-app@latest my-strapi-cms
cd my-strapi-cms
npm run develop

Step 2: Configure Plugin

Add the plugin to your medusa-config.js:

const plugins = [
  // ... other plugins
  {
    resolve: "@devx-commerce/strapi",
    options: {
      strapi_url: process.env.STRAPI_URL || "http://localhost:1337",
      strapi_api_token: process.env.STRAPI_API_TOKEN,
      // Additional configuration
    },
  },
]

Step 3: Environment Variables

Add Strapi credentials to your .env:

STRAPI_URL=http://localhost:1337
STRAPI_API_TOKEN=your_strapi_api_token

Usage

Content Types

Create content types in Strapi for:

Product Content

Blog Posts

Pages

Collections

Creating Content Models

In Strapi admin panel:

  1. Navigate to Content-Type Builder
  2. Create a new collection type (e.g., “Product Description”)
  3. Add fields:
    • Text fields for content
    • Rich text for formatted content
    • Media fields for images
    • Relation fields to link with Medusa products
  4. Save and enable the content type

Syncing Content

The plugin automatically syncs content between Medusa and Strapi:

// Content is accessible through Medusa API
// with Strapi-managed content attached

API Integration

Access Strapi content through Medusa:

// Fetch product with Strapi content
const product = await productService.retrieve(productId, {
  relations: ["strapi_content"],
})

// Access extended description from Strapi
const extendedDescription = product.strapi_content.description

Content Management Workflow

1. Product Descriptions

Manage rich product descriptions in Strapi:

2. Blog & SEO Content

Build content marketing with Strapi:

3. Marketing Pages

Design marketing pages:

Strapi Features

Rich Text Editor

Media Library

Internationalization (i18n)

Roles & Permissions

Advanced Features

Custom Fields

Create custom fields for specific needs:

Content Relations

Link content across types:

Webhooks

Set up webhooks for real-time sync:

Best Practices

  1. Content Structure - Plan content models before implementation
  2. SEO Optimization - Use Strapi’s SEO plugin for metadata
  3. Media Optimization - Optimize images before upload
  4. Version Control - Use content versioning for important changes
  5. Backup Content - Regular backups of Strapi database
  6. Access Control - Implement proper role-based permissions
  7. Performance - Use caching for frequently accessed content

Use Cases

E-commerce Content

Content Marketing

Multi-Channel Content


Explore More Medusa Plugins

Find more powerful plugins and integrations to enhance your Medusa store. Browse our collection of community-driven solutions.

Free & Open Source
Community Driven
Easy Integration