User profiles

Concept: User profiles

First visit

Omit accessToken on EmbetOverlay. In onInitialized, persist profile.accessToken on your user record.

<EmbetOverlay
  clientId="YOUR_CLIENT_ID"
  customId="YOUR_EVENT_ID"
  sdkVersion="1.4.0"
  onInitialized={async (profile) => {
    await saveTokenToUserProfile(profile.accessToken);
  }}
/>

Returning user

Pass the saved token so the SDK restores the same profile (see MAU notes on the concept page).

const savedAccessToken = await loadTokenFromUserProfile();

<EmbetOverlay
  clientId="YOUR_CLIENT_ID"
  customId="YOUR_EVENT_ID"
  sdkVersion="1.4.0"
  accessToken={savedAccessToken}
/>

Pair profile custom_data with Segmentation when you target content in the CMS.