Contentful Personalization & Analytics
    Preparing search index...

    Interface ResolvedData<S, M, L>

    Result returned by OptimizedEntryResolver.resolve.

    interface ResolvedData<
        S extends EntrySkeletonType,
        M extends ChainModifiers = ChainModifiers,
        L extends LocaleCode = LocaleCode,
    > {
        entry: Entry<S, M, L>;
        isEmptyVariant?: true;
        optimizationContextId?: string;
        selectedOptimization?: {
            experienceId: string;
            sticky?: boolean;
            variantIndex: number;
            variants: Record<string, string>;
        };
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    entry

    entry: Entry<S, M, L>

    The baseline or resolved variant entry.

    isEmptyVariant?: true

    Whether the resolved variant is an empty variant — a deliberate author choice to render nothing for this audience. When true, the entry field still contains the baseline entry (used for tracking context) but renderers must display no content. This is distinct from a baseline selection (variantIndex === 0) and from a resolution error (broken variant link), both of which render the baseline entry.

    An empty variant is detected by selectedVariant.id === ''. Empty variants appear in two forms in Contentful CDA nt_config data:

    • { id: "", hidden: true } — the author explicitly chose "Use empty variant" in the Personalization UI. This is the deliberate author intent for this feature.
    • { id: "", hidden: false } — an unfilled placeholder slot, created programmatically when a variant is added or unlinked but not yet configured.

    Both forms produce isEmptyVariant: true. The hidden field is not used for detection because the Experience API strips it before runtime — it only survives in the Contentful CDA nt_config payload. Using id === '' catches both forms and is stable across all data sources.

    optimizationContextId?: string

    Opaque runtime-owned optimization context ID for entry interaction tracking.

    selectedOptimization?: {
        experienceId: string;
        sticky?: boolean;
        variantIndex: number;
        variants: Record<string, string>;
    }

    The selected optimization metadata, if a matching optimization was selected.

    Type Declaration

    • experienceId: string

      Identifier of the personalization or experiment experience.

    • Optionalsticky?: boolean

      Indicates whether this optimization selection is sticky for the user.

      false
      

      Reuse sticky selections on subsequent requests for the same user rather than re-allocating a new variant.

    • variantIndex: number

      Index of the selected variant within the experience configuration.

      Typically corresponds to the index of the selected OptimizationConfig entry.

    • variants: Record<string, string>

      Mapping of baseline entry IDs to their selected variant entry IDs.

      The keys are component identifiers and the values are the identifiers of the selected variant for that component.