Local setup
This page is for developers working on CDP or validating an integration locally.
Run CDP standalone
Section titled “Run CDP standalone”pnpm installpnpm dev # http://localhost:5001Run CDP inside the Segmentify dashboard
Section titled “Run CDP inside the Segmentify dashboard”Start the CDP remote, then run the dashboard with the CDP local flag:
# Terminal 1 — CDP remotepnpm dev:remote # builds + previews on :5001, rebuilds on save
# Terminal 2 — dashboardCDP_LOCAL=true pnpm devBy default the dashboard loads the deployed cdp-dev.segmentify.com remote;
CDP_LOCAL=true points it at http://localhost:5001 instead.
To run all MFE remotes locally:
cd dashboardCDP_LOCAL=true CHM_LOCAL=true REPORTS_LOCAL=true pnpm dev:mfe| MFE | Federation import | Base path | Local port |
|---|---|---|---|
| CDP | cdpApp/App |
/customer-data-platform |
5001 |
| Channel Marketing | chmApp/App |
/channel-marketing |
5002 |
| Reports | rpsApp/App |
/reports/... |
5003 |
Build common (monorepo)
Section titled “Build common (monorepo)”When working across the monorepo, rebuild @segmentify/common after changes:
cd common && pnpm buildcd ../cdp-fr && pnpm install # refresh linked distPartner sandbox (iframe host simulation)
Section titled “Partner sandbox (iframe host simulation)”The partner-sandbox app in the @segmentify/common monorepo simulates an external
company embedding CDP (and the other MFEs) over the postMessage bridge:
# In the common monorepocd common && pnpm build
cd ../cdp-fr && pnpm install && pnpm dev:remote # :5001cd ../partner-sandbox && pnpm install && pnpm dev # :5100Open http://localhost:5100, select CDP, enter dev credentials in the sidebar (API key,
Bearer token, X-Switch-User, X-Switch-Region), then reload the iframe. The sandbox
sends hostBaseUrl: https://sauron-dev.segmentify.com and
cdpBaseUrl: https://api-dev.segmentify.com.
Documentation site
Section titled “Documentation site”This docs site lives in docs-site/. From the repo root:
pnpm docs:dev # dev serverpnpm docs:build # static build to docs-site/dist/pnpm docs:preview # preview the build