Overview
Icon for Greta CMS Sync

Greta CMS Sync

Sync products with Greta's CMS

Greta Medusa Plugin

Copy to clipboard@questlabs/greta-medusa-plugin connects a Medusa v2 store to Greta's CMS connector API. It syncs published products as discoverable content and can import Greta work as unpublished Medusa product drafts. It never publishes or updates an existing product.

Requirements

  • Medusa v2.3 or newer (tested against 2.21.2) and Node.js 20 or newer.
  • A Greta project connection created for platform Copy to clipboardmedusa.
  • Enable that connection in Greta before the plugin can sync. Keep the one-time connector key in the Medusa server/worker environment, never in storefront code.

Install

npm install @questlabs/greta-medusa-plugin

Add this entry to the Copy to clipboardplugins array in your existing Copy to clipboardmedusa-config.ts:

{
resolve: "@questlabs/greta-medusa-plugin",
options: {},
}

Set these environment variables in both the server and worker deployment (scheduled jobs run in the worker):

GRETA_CMS_ENABLED=true
GRETA_CMS_API_KEY=grc_sk_... # generated once by Greta for this Medusa store
GRETA_CMS_API_URL=https://app.greta.sh/api/greta/cms
GRETA_CMS_SITE_URL=https://www.example.com
GRETA_MEDUSA_IMPORT_DRAFTS=false

The plugin runs its published-product sync hourly. The connection must already be enabled in Greta. No products, credentials, or draft content are read until Copy to clipboardGRETA_CMS_ENABLED=true and a valid connector key are set.

Product sync

The plugin queries Medusa products using Copy to clipboardstatus: "published" and sends only the product ID, title, handle, subtitle, description, and update timestamp. It does not send prices, inventory, customer/order data, images, or unpublished products. The default canonical URL is Copy to clipboardhttps://your-store/products/<handle>; set Copy to clipboardGRETA_CMS_SITE_URL to the public storefront origin.

Greta drafts

Draft import is opt-in. Enable Copy to clipboardGRETA_MEDUSA_IMPORT_DRAFTS=true only when you want Greta content delivered to Medusa as catalog drafts. Products are created with Copy to clipboardstatus: "draft", a deterministic handle, and an idempotency marker. A repeated delivery reuses the matching draft rather than creating another product. The connector never changes status to published. Draft delivery also requires the Greta key to have Copy to clipboarddraft:pull and Copy to clipboarddraft:ack scopes.

Safety and operation

  • Sync and draft import are disabled by default.
  • HTTPS is required except on localhost development URLs.
  • The API key is sent only from the Medusa server/worker to Greta.
  • Sync includes only explicitly selected published product fields.
  • Draft creation is off unless separately enabled and creates reviewable drafts only.
  • This plugin does not publish products, mutate existing products, or handle store/customer/order data.
  • If Medusa runs separate server and worker processes, configure the same environment variables in the worker; the scheduled job does not run in a server-only worker mode.

Build before publishing:

npm run build
npm test
npm publish --access public

The connection, content-sync, and draft-delivery endpoints are provided by Greta's CMS connector service.

You may also like

Browse all integrations

Build your own

Develop your own custom integration

Build your own integration with our API to speed up your processes. Make your integration available via npm for it to be shared in our Library with the broader Medusa community.

gift card interface

Ready to build your custom commerce setup?