Integrations

SCM/DCM module integration

Edit this page

SCM/DCM module integration

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.

Overview

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:

  • AI-assisted demand intelligence
  • Industry Pack policy overlays (Healthcare, Pharma, Retail, Manufacturing, Food & Beverage, Construction)
  • Compliance reporting pipelines
  • Multi-tenant isolation

Industry Packs are proprietary; OSS module APIs remain Apache-2.0.

Installing packages

1npm install @betterdata/scm-contracts @betterdata/scm-inventory @betterdata/scm-procurement
2npm install @betterdata/dcm-contracts @betterdata/dcm-orders @betterdata/dcm-demand @betterdata/dcm-returns

Runtime configuration (self-hosted)

Wire 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 client
16 outbox,
17 readChannelMessages,
18});

Similar entry points exist for other modules, for example:

  • configureProcurementRuntime@betterdata/scm-procurement
  • configureExecutionRuntime@betterdata/scm-execution
  • configureDcmOrdersRuntime@betterdata/dcm-orders
  • configureDcmReturnsRuntime@betterdata/dcm-returns

@betterdata/dcm-demand today exposes services and loop participation; wire adapters from your app bootstrap as shown in package READMEs.

Hosted platform

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).

Loop participation

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.* constants
6"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

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.

SCM packages
DCM packages
Loop definitions