Integrations
Use @betterdata/scm-* and @betterdata/dcm-* modules as the operational layer of the Commerce Chain Optimization (CCO) platform — in the hosted product or in your own stack.
SCM modules cover supply (inventory, procurement, execution, catalog).
DCM modules cover demand (demand signals, orders, returns, channels).
In the Better Data hosted platform, these modules run with:
Industry Packs are proprietary; OSS module APIs remain Apache-2.0.
1npm install @betterdata/scm-contracts @betterdata/scm-inventory @betterdata/scm-procurement2npm install @betterdata/dcm-contracts @betterdata/dcm-orders @betterdata/dcm-demand @betterdata/dcm-returnsWire infrastructure once at process startup. Example — inventory:
1import { configureInventoryRuntime } from "@betterdata/scm-inventory";2import type { ChannelReader, OutboxWriter } from "@betterdata/scm-contracts";3 4const outbox: OutboxWriter = {5 async write(_entry, _tx) {6 /* your outbox persistence */7 },8};9 10const readChannelMessages: ChannelReader = async (_args) => {11 /* your channel reader */12};13 14configureInventoryRuntime({15 getDb: () => prisma, "cmt">// Prisma or compatible client16 outbox,17 readChannelMessages,18});Similar entry points exist for other modules, for example:
configureProcurementRuntime — @betterdata/scm-procurementconfigureExecutionRuntime — @betterdata/scm-executionconfigureDcmOrdersRuntime — @betterdata/dcm-ordersconfigureDcmReturnsRuntime — @betterdata/dcm-returns@betterdata/dcm-demand today exposes services and loop participation; wire adapters from your app bootstrap as shown in package READMEs.
Inside app.betterdata.com, the platform kernel provides database and outbox implementations — you typically do not hand-wire configure*Runtime for first-party apps.
For self-hosted topology and runtime topics, see commercechain.io (external).
Each module exports a loop participant manifest (for example inventoryLoopParticipant) conforming to LoopParticipantManifest from @betterdata/loop-definitions.
1import { inventoryLoopParticipant } from "@betterdata/scm-inventory";2import { EventNames, LoopIds } from "@betterdata/loop-definitions";3 4"cmt">// inventoryLoopParticipant.moduleId === "scm.inventory"5"cmt">// inventoryLoopParticipant.handles[].event uses EventNames.* constants6"cmt">// inventoryLoopParticipant.handles[].loops reference LoopIds.*The hosted platform registers these manifests automatically. For custom runtimes, register participants with your Loop Engine instance.
Participant reference validation lives in @betterdata/loop-actors tests — unknown LoopIds / EventNames fail CI.
Industry Packs apply vertical policy on top of OSS defaults. They are not published to npm. Available verticals include Healthcare, Pharma, Retail, Manufacturing, Food & Beverage, and Construction.
