Prerequisites
Before embedding CDP, make sure you have the following.
Credentials
Section titled “Credentials”| Item | Description |
|---|---|
| API key | Segmentify account API key. Sent as the apiKey query parameter on CDP API calls and exposed to the app as React context. |
| Auth token (Bearer) | Short-lived token the MFE sends as Authorization: Bearer … to Segmentify APIs. |
| Datacenter | eq or gc in production — determines the CDP API host. Supply as dataCenter in host data. |
Platform configuration (Segmentify side)
Section titled “Platform configuration (Segmentify side)”- Your host domain(s) added to the Segmentify API CORS allowlist.
- For iframe embeds, the CDP embed origin serves a
Content-Security-Policy: frame-ancestorsthat includes your domain.
Package
Section titled “Package”For the Module Federation mount path, or to use the typed postMessage host helper, install the shared package:
pnpm add @segmentify/commonThe current supported version is 0.0.15. For a plain iframe embed you can implement the postMessage protocol manually without the package (see PostMessage protocol).
Choose an integration mode
Section titled “Choose an integration mode”| Mode | Best for | Complexity |
|---|---|---|
| iframe + postMessage | Any host stack (including Angular); strong isolation | Low |
Module Federation mount |
React-capable hosts wanting deep UI integration | Medium |
See the Quickstart to get running, or the Angular integration guide for framework-specific examples.