Profile Sync

When syncWithProfile: true is set on LeadsOptions (or as a direct prop on CollectLead), submitted form data is automatically written to the user's Fans United profile after a successful lead submission. This is opt-in and defaults to false.

How it works

  1. The user submits the lead form.
  2. The component calls sdk.leads.create(...) as normal.
  3. If the call succeeds and syncWithProfile is true, the component then calls the SDK profile namespace with the user's data:
    sdk.profile.getOwn()
      .setName(...)
      .setEmail(...)
      // ...other setters
      .update();
  4. The user proceeds to the next stage regardless of profile-sync result. Profile-sync errors are logged but do not break the flow.

Synced fields

Only fields that are both included in the form configuration and have non-empty values are synced. Other fields on the profile are left untouched.

FieldSynced as
fullNameProfile name (takes priority over firstName/lastName)
firstName + lastNameCombined as "firstName lastName" when both present
firstName onlyProfile name
lastName onlyProfile name
emailProfile email
phoneNumberProfile phone number
phoneCountryCodeProfile phone country code
countryProfile country
genderProfile gender

Name field priority

  1. If fullName is configured and has a value, it sets the profile name directly.
  2. Otherwise, if both firstName and lastName are configured and have values, the combined "firstName lastName" is used.
  3. Otherwise, firstName (if present) or lastName (if present) is used alone.

Enable on game components

import { LeadsOptions } from "fansunited-frontend-core";

const leads: LeadsOptions = {
  position: "after",
  fields: ["firstName", "lastName", "email", "phoneNumber", "country"],
  campaignId: "engagement-2024",
  campaignName: "Engagement Sync Campaign",
  syncWithProfile: true,
};

<ClassicQuizPlay {...otherProps} leads={leads} />

Enable on CollectLead

CollectLead exposes syncWithProfile as a top-level prop:

<CollectLead
  entityId="lead-form-123"
  sdk={sdk}
  template={WidgetTemplate.STANDARD}
  language="en"
  fields={["firstName", "lastName", "email", "phoneNumber"]}
  syncWithProfile={true}
/>

Use cases

  • Registration forms that double as profile updates.
  • Newsletter signups that capture additional profile information.
  • Engagement campaigns where you want a lead-and-profile event in one submission.
  • Contact forms that enhance existing profiles with new fields.

Behavior notes

  • Opt-in by default. If syncWithProfile is omitted, no profile mutation happens.
  • Failures are isolated. A profile-sync error never blocks the lead submission — the user still sees the success screen.
  • Empty fields are skipped. A configured but empty field will not overwrite an existing profile value.
  • No deletions. Profile sync only sets values; it never clears or removes existing profile data.