Contentful Personalization & Analytics
    Preparing search index...

    Interface UseOptimizedEntryResult<TEntry>

    Resolved entry state returned by useOptimizedEntry.

    interface UseOptimizedEntryResult<
        TEntry extends Entry
        | undefined = Entry | undefined,
    > {
        baselineEntry: TEntry;
        entry: TEntry;
        error: Error | undefined;
        isLoading: boolean;
        isPresentationReady: boolean;
        isResolved: boolean;
        metadata:
            | OptimizedEntryMetadata<EntrySkeletonType, ChainModifiers, string>
            | undefined;
        resolvedData: ResolvedData<EntrySkeletonType>;
        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

    • TEntry extends Entry | undefined = Entry | undefined
    Index

    Properties

    baselineEntry: TEntry

    Readonlyentry

    entry: TEntry
    error: Error | undefined
    isLoading: boolean
    isPresentationReady: boolean

    Whether the presentation layer can render resolved entry content.

    isResolved: boolean
    metadata:
        | OptimizedEntryMetadata<EntrySkeletonType, ChainModifiers, string>
        | undefined
    selectedOptimization:
        | {
            experienceId: string;
            sticky?: boolean;
            variantIndex: number;
            variants: Record<string, string>;
        }
        | undefined

    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

    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