Contentful Personalization & Analytics
    Preparing search index...

    Interface OptimizedEntryMetadata<S, M, L>

    Baseline and resolved-entry metadata for optimized-entry render surfaces.

    interface OptimizedEntryMetadata<
        S extends EntrySkeletonType = EntrySkeletonType,
        M extends ChainModifiers = ChainModifiers,
        L extends LocaleCode = LocaleCode,
    > {
        baselineEntry: Entry<S, M, L>;
        baselineEntryId: string;
        entry: Entry<S, M, L>;
        entryId: string;
        optimizationContextId: string | undefined;
        resolvedData: ResolvedData<S, M, L>;
        selectedOptimization:
            | {
                experienceId: string;
                sticky?: boolean;
                variantIndex: number;
                variants: Record<string, string>;
            }
            | undefined;
        selectedOptimizations: | {
            experienceId: string;
            sticky?: boolean;
            variantIndex: number;
            variants: Record<string, string>;
        }[]
        | undefined;
    }

    Type Parameters

    Index

    Properties

    baselineEntry: Entry<S, M, L>

    Entry supplied by the caller or fetched before optimization resolution.

    baselineEntryId: string

    ID of the baseline entry supplied by the caller or fetched before optimization resolution.

    Readonlyentry

    entry: Entry<S, M, L>

    Baseline or resolved variant entry.

    entryId: string

    ID of the baseline or resolved variant entry.

    optimizationContextId: string | undefined

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

    resolvedData: ResolvedData<S, M, L>

    Full resolved entry payload returned by the optimization resolver.

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

    Selected optimization metadata, if a matching optimization was selected.

    Type Declaration

    • {
          experienceId: string;
          sticky?: boolean;
          variantIndex: number;
          variants: Record<string, string>;
      }
      • 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.

    • undefined
    selectedOptimizations:
        | {
            experienceId: string;
            sticky?: boolean;
            variantIndex: number;
            variants: Record<string, string>;
        }[]
        | undefined

    Selected optimizations used to resolve this entry, when available.

    Type Declaration

    • {
          experienceId: string;
          sticky?: boolean;
          variantIndex: number;
          variants: Record<string, string>;
      }[]
      • 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.

    • undefined