BCMS (https://thebcms.com) integration for Medusa v2 - link CMS entries to products and serve them through Medusa's admin and storefront APIs.
Link BCMS entries to products by slot (e.g. , ), with per-slot template allowlists in admin, and serve resolved content through store API routes.
Register in :
Run migrations:
npx medusa db:migrate| Option | Type | Default | Description |
|---|---|---|---|
| — | BCMS API key (required for BCMS calls). | ||
| BCMS default | Your BCMS instance URL. | ||
| Client cache. Set for live preview. | |||
| Verbose BCMS client logs. |
Auth: Medusa publishable API key (via JS SDK).
| Method | Path | Description |
|---|---|---|
| GET | Product + resolved entries in . | |
| GET | Single entry by id. | |
| GET | Single entry by slug. |
Standalone entry/page routes only allow templates configured on at least one slot (or all templates if any slot has an empty allowlist). Linked entries on the product route are always returned.
Query linked entries in custom routes:
Types:
In a Medusa app:
npm install @thebcms/medusa-plugin1import { defineConfig, loadEnv } from "@medusajs/framework/utils"2
3loadEnv(process.env.NODE_ENV || "development", process.cwd())4
5module.exports = defineConfig({6 plugins: [7 {8 resolve: "@thebcms/medusa-plugin",9 options: {10 apiKey: process.env.BCMS_API_KEY,11 },12 },13 ],14})1import Medusa from "@medusajs/js-sdk"2
3const sdk = new Medusa({4 baseUrl: process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL!,5 publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY!,6})7
8const { product, bcms } = await sdk.client.fetch(9 `/store/bcms/products/${productId}`10)11
12const richText = bcms.slots["rich_description"]?.[0]?.entry13const blogs = bcms.slots["recommended_blogs"] ?? []1const { data } = await query.graph({2 entity: "product",3 fields: ["id", "title", "bcms_links.*"],4 filters: { id: productId },5})1import type {2 BcmsModuleOptions,3 BcmsLinkPayload,4 BcmsSettingPayload,5} from "@thebcms/medusa-plugin/modules/bcms"1npm install2npx medusa plugin:publish # local yalc registry3npx medusa plugin:develop # watch + rebuild1npx medusa plugin:add @thebcms/medusa-plugin2npx medusa db:migrate