> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Scm dcm modules

# 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

```bash theme={null}
npm install @betterdata/scm-contracts @betterdata/scm-inventory @betterdata/scm-procurement
npm 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:

```typescript theme={null}
import { configureInventoryRuntime } from "@betterdata/scm-inventory";
import type { ChannelReader, OutboxWriter } from "@betterdata/scm-contracts";

const outbox: OutboxWriter = {
  async write(_entry, _tx) {
    /* your outbox persistence */
  },
};

const readChannelMessages: ChannelReader = async (_args) => {
  /* your channel reader */
};

configureInventoryRuntime({
  getDb: () => prisma, // Prisma or compatible client
  outbox,
  readChannelMessages,
});
```

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](https://commercechain.io/docs) (external).

## Loop participation

Each module exports a **loop participant manifest** (for example `inventoryLoopParticipant`) conforming to `LoopParticipantManifest` from `@loop-engine/definitions`.

```typescript theme={null}
import { inventoryLoopParticipant } from "@betterdata/scm-inventory";
import { EventNames, LoopIds } from "@loop-engine/definitions";

// inventoryLoopParticipant.moduleId === "scm.inventory"
// inventoryLoopParticipant.handles[].event uses EventNames.* constants
// 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 **`@loop-engine/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](/oss/scm-packages)\
→ [DCM packages](/oss/dcm-packages)\
→ [Loop definitions](/oss/loop-definitions)
