Contentful Personalization & Analytics
    Preparing search index...
    interface PersonalizationProps {
        baselineEntry: Entry;
        children: (resolvedEntry: Entry) => ReactNode;
        liveUpdates?: boolean;
        style?: StyleProp<ViewStyle>;
        testID?: string;
        threshold?: number;
        viewTimeMs?: number;
    }
    Index

    Properties

    baselineEntry: Entry

    The baseline Contentful entry fetched with { include: 10 }. Must include nt_experiences field with linked personalization data.

    const baselineEntry = await contentful.getEntry('hero-baseline-id', {
    include: 10 // Required to load all variant data
    })
    children: (resolvedEntry: Entry) => ReactNode

    Render prop that receives the resolved variant entry. Called with the baseline entry if no personalization matches, or with the selected variant entry if personalization applies.

    Type declaration

      • (resolvedEntry: Entry): ReactNode
      • Parameters

        • resolvedEntry: Entry

          The entry to display (baseline or variant)

        Returns ReactNode

        ReactNode to render

    <Personalization baselineEntry={entry}>
    {(resolvedEntry) => (
    <HeroComponent
    title={resolvedEntry.fields.title}
    image={resolvedEntry.fields.image}
    />
    )}
    </Personalization>
    liveUpdates?: boolean

    Whether this component should react to personalization state changes in real-time. When undefined, inherits from OptimizationRoot's liveUpdates setting. When false (or inherited as false), the component "locks" to the first variant it receives, preventing UI flashing when user actions change their qualification. When true, the component updates immediately when personalizations change.

    Note: Live updates are always enabled when the preview panel is open, regardless of this setting.

    undefined (inherits from OptimizationRoot)
    
    style?: StyleProp<ViewStyle>

    Optional style prop for the wrapper View

    testID?: string

    Optional testID for testing purposes

    threshold?: number

    Minimum visibility ratio (0.0 - 1.0) required to consider component "visible".

    0.8 (80% of the component must be visible in viewport)
    
    viewTimeMs?: number

    Minimum time (in milliseconds) the component must be visible before tracking fires.

    2000 (2 seconds)