Skip to content

Local setup

This page is for developers working on CDP or validating an integration locally.

Terminal window
pnpm install
pnpm dev # http://localhost:5001

Start the CDP remote, then run the dashboard with the CDP local flag:

Terminal window
# Terminal 1 — CDP remote
pnpm dev:remote # builds + previews on :5001, rebuilds on save
# Terminal 2 — dashboard
CDP_LOCAL=true pnpm dev

By default the dashboard loads the deployed cdp-dev.segmentify.com remote; CDP_LOCAL=true points it at http://localhost:5001 instead.

The partner-sandbox app in the @segmentify/common monorepo simulates an external company embedding CDP (and the other MFEs) over the postMessage bridge:

Terminal window
# In the common monorepo
cd common && pnpm build
cd ../cdp-fr && pnpm install && pnpm dev:remote # :5001
cd ../partner-sandbox && pnpm install && pnpm dev # :5100

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

This docs site lives in docs-site/. From the repo root:

Terminal window
pnpm docs:dev # dev server
pnpm docs:build # static build to docs-site/dist/
pnpm docs:preview # preview the build