Select Centra products, exact product variants, and buyable SKU/size items directly from DatoCMS records.
Centra remains the source of truth for catalog data. The plugin stores only stable reference IDs in DatoCMS and loads names, media, prices, availability, stock, SKU values, and other product details live from Centra.
Item IDsInstall Centra from the DatoCMS Marketplace, or install the npm package manually:
datocms-plugin-centraThe plugin does not request DatoCMS API permissions.
Open the plugin settings and enter:
Select Save and connect. The plugin validates the credentials by loading one catalog page before saving. The same Centra connection is used in every DatoCMS environment.
The bearer token is stored directly in DatoCMS plugin parameters and is used by the browser through the DatoCMS CORS relay. Masking the input prevents casual disclosure on the settings screen, but it does not turn the token into a server-side secret. Use a dedicated read-only no-session catalog token and restrict access to the DatoCMS project appropriately.
The plugin never uses a Centra shared secret, AMS credentials, or a customer-hosted proxy.
Changing a populated field to an incompatible kind or changing a multi-value field with several references to single cardinality does not discard or reinterpret data. The editor asks for an explicit clear or replacement.
Configure the JSON field for products, exact product variants, or individual SKU/size items.

Search the live Centra catalog, compare image-backed variants, and stage one or more selections before applying them.

Expand a product variant and select the exact Centra Item. Repeated SKU strings remain separate rows with their own size and Item ID.

Saved references are rendered with current Centra images, variant details, and availability while the JSON value keeps only stable IDs.

The JSON field contains a versioned document. null is the only empty value.
{ "version": 1, "kind": "primaryProduct", "references": [{ "displayItemId": 2752 }]}{ "version": 1, "kind": "variant", "references": [ { "displayItemId": 2752 }, { "displayItemId": 2810 } ]}{ "version": 1, "kind": "item", "references": [ { "displayItemId": 2752, "itemId": "opaque-centra-item-id" } ]}The plugin intentionally does not store product names, URIs, images, prices, stock, SKU strings, GTINs, or full product snapshots. Those values can change in Centra and are loaded live.
Fetch DisplayItems by the stored numeric IDs. For item references, locate the exact nested item using the stored opaque itemId.
query ResolveCentraReferences( $displayItemIds: [Int!] $market: [Int!] $pricelist: [Int!] $languageCode: [String!]) { displayItems( where: { id: $displayItemIds } limit: 100 market: $market pricelist: $pricelist languageCode: $languageCode ) { list { id name productNumber isPrimaryVariant available hasStock productVariant { id name number } items { id name sku GTIN preorder stock { available } } } }}Reorder the response using the stored references array. Keep a placeholder for missing DisplayItems or Items instead of silently dropping them.
Centra exposes buyable sizes as Item objects nested below a DisplayItem. A SKU string is display metadata, not a safe identity: stores can contain repeated SKU values, including repeated values within one DisplayItem.
The plugin therefore stores this pair:
type CentraItemReference = { displayItemId: number; itemId: string;};SKU search first asks Centra for matching DisplayItems, then ranks exact nested SKU and GTIN matches in the returned products. Every duplicate match remains selectable. The plugin never scans the entire catalog in the browser.
Market, pricelist, language, and Centra allocation rules can change what is visible or available. Product and item stock shown in DatoCMS is the current Storefront API response, not a guarantee that checkout will succeed later.
Missing or inactive references remain visible in the field editor with their stored IDs so editors can remove or replace them deliberately.
The plugin uses the market, pricelist, and language defaults exposed by the configured no-session endpoint. Adjust those defaults in Centra if the catalog response is not the one editors should browse.
The selected DisplayItem is pinned. If Centra later assigns another primary variant, the plugin warns and leaves the existing reference untouched. Replace it explicitly if the content should follow the new primary choice.
npm installnpm run devThen install a private plugin in DatoCMS with http://localhost:5173/ as its entry point.
Run all local checks with:
npm run lintnpm testnpm run build