Skip to content

Prerequisites

Before embedding CDP, make sure you have the following.

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.
  • Your host domain(s) added to the Segmentify API CORS allowlist.
  • For iframe embeds, the CDP embed origin serves a Content-Security-Policy: frame-ancestors that includes your domain.

For the Module Federation mount path, or to use the typed postMessage host helper, install the shared package:

Terminal window
pnpm add @segmentify/common

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

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.