Contentful Personalization & Analytics
    Preparing search index...

    Core runtime for stateless environments.

    Built on top of CoreBase.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Shared Optimization API client instance.

    config: CoreConfig

    Resolved core configuration.

    eventBuilder: EventBuilder

    Shared event builder instance.

    flagsResolver: {
        resolve(
            changes?: {
                key: string;
                meta: { experienceId: string; variantIndex: number };
                type: "Variable";
                value: string | number | boolean | Record<string, JSONType> | null;
            }[],
        ): Flags;
    } = FlagsResolver

    Static resolver for evaluating optimized custom flags.

    Type Declaration

    • resolve: function
      • Build a flattened map of flag keys to values from a change list.

        Parameters

        • Optionalchanges: {
              key: string;
              meta: { experienceId: string; variantIndex: number };
              type: "Variable";
              value: string | number | boolean | Record<string, JSONType> | null;
          }[]

          The change list returned by the optimization service.

          • key: string

            Key identifying the subject of the change.

          • meta: { experienceId: string; variantIndex: number }

            Metadata describing the originating experience and variant index.

            • experienceId: string

              Identifier of the personalization or experiment experience.

            • variantIndex: number

              Index of the variant within the experience configuration.

              Typically corresponds to the array index in the experience's distribution.

          • type: "Variable"

            Discriminator for a variable change.

          • value: string | number | boolean | Record<string, JSONType> | null

            New value for the variable identified by ChangeBase.key.

        Returns Flags

        A map of flag keys to their resolved values.

        const flags = FlagsResolver.resolve(data.changes)
        if (flags['theme'] === 'dark') enableDarkMode()

        // Handles wrapped values produced by the API

        const flags = FlagsResolver.resolve([
        { type: 'Variable', key: 'price', value: { value: { amount: 10, currency: 'USD' } } }
        ])
        console.log(flags.price.amount) // 10
    interceptors: LifecycleInterceptors = ...

    Lifecycle interceptors for events and state updates.

    mergeTagValueResolver: {
        getValueFromProfile(
            id: string,
            profile?: {
                audiences: string[];
                id: string;
                location: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                random: number;
                session: {
                    activeSessionLength: number;
                    averageSessionLength: number;
                    count: number;
                    id: string;
                    isReturningVisitor: boolean;
                    landingPage: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                };
                stableId: string;
                traits: Record<string, JSONType>;
            },
        ): string
        | undefined;
        normalizeSelectors(id: string): string[];
        resolve(
            mergeTagEntry:
                | {
                    fields: {
                        nt_fallback?: string;
                        nt_mergetag_id: string;
                        nt_name: string;
                    };
                    metadata: {
                        concepts?: {
                            sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                        }[];
                        tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                    };
                    sys: {
                        contentType: {
                            sys: { id: "nt_mergetag"; linkType: "ContentType"; type: "Link" };
                        };
                        createdAt: any;
                        environment: {
                            sys: { id: string; linkType: "Environment"; type: "Link" };
                        };
                        id: string;
                        locale?: string;
                        publishedVersion: number;
                        revision: number;
                        space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                        type: "Entry";
                        updatedAt: any;
                    };
                }
                | undefined,
            profile?: {
                audiences: string[];
                id: string;
                location: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                random: number;
                session: {
                    activeSessionLength: number;
                    averageSessionLength: number;
                    count: number;
                    id: string;
                    isReturningVisitor: boolean;
                    landingPage: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                };
                stableId: string;
                traits: Record<string, JSONType>;
            },
        ): string
        | undefined;
    } = MergeTagValueResolver

    Static resolver for merge-tag lookups against profile data.

    Type Declaration

    • getValueFromProfile: function
      • Look up a merge-tag value from a profile using normalized selectors.

        Parameters

        • id: string

          Merge-tag identifier.

        • Optionalprofile: {
              audiences: string[];
              id: string;
              location: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              };
              random: number;
              session: {
                  activeSessionLength: number;
                  averageSessionLength: number;
                  count: number;
                  id: string;
                  isReturningVisitor: boolean;
                  landingPage: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
              };
              stableId: string;
              traits: Record<string, JSONType>;
          }

          Profile from which to resolve the value.

          • audiences: string[]

            List of audience identifiers that this profile currently belongs to.

          • id: string

            Primary identifier of the profile.

          • location: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            }

            Geo-location information associated with the profile.

            • Optionalcity?: string

              City name associated with the location.

            • Optionalcontinent?: string

              Continent name associated with the location.

            • Optionalcoordinates?: { latitude: number; longitude: number }

              Geographical coordinates for the location.

              • latitude: number

                Latitude component of the coordinates.

              • longitude: number

                Longitude component of the coordinates.

            • Optionalcountry?: string

              Country name associated with the location.

            • OptionalcountryCode?: string

              Country code associated with the location.

              Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

            • OptionalpostalCode?: string

              Postal or ZIP code associated with the location.

            • Optionalregion?: string

              Region or state name associated with the location.

            • OptionalregionCode?: string

              Region or state code associated with the location.

            • Optionaltimezone?: string

              Time zone identifier associated with the location.

              Typically an IANA time zone string (e.g., "Europe/Berlin").

          • random: number

            Random value associated with the profile.

            Often used for deterministic bucketing (e.g., in experiments).

          • session: {
                activeSessionLength: number;
                averageSessionLength: number;
                count: number;
                id: string;
                isReturningVisitor: boolean;
                landingPage: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
            }

            Aggregated session statistics for the profile.

            • activeSessionLength: number

              Duration of the active session.

            • averageSessionLength: number

              Average session duration across all sessions represented by this record.

              The unit should match SessionStatistics.activeSessionLength.

            • count: number

              Number of sessions associated with this profile or identifier.

              Often used in combination with SessionStatistics.averageSessionLength.

            • id: string

              Unique identifier for this session statistics record.

            • isReturningVisitor: boolean

              Indicates whether the visitor has been seen before.

              true typically means the visitor has at least one prior session.

            • landingPage: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }

              Landing page for the session.

              Represents the first page the user visited in this session.

              Page

              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

          • stableId: string

            Stable, long-lived identifier of the profile.

            Intended to remain constant across sessions and devices when possible. Usually equal to id.

          • traits: Record<string, JSONType>

            Traits describing the profile (user-level attributes).

            Traits

        Returns string | undefined

        A stringified primitive if found; otherwise undefined.

        Only string/number/boolean primitives are returned; objects/arrays are ignored.

        const value = MergeTagValueResolver.getValueFromProfile('user_email', profile)
        if (value) sendEmailTo(value)
    • normalizeSelectors: function
      • Generate a list of candidate selectors for a merge-tag ID.

        Parameters

        • id: string

          Merge-tag identifier (segments separated by _).

        Returns string[]

        Array of dot-path selectors to try against a profile.

        // "profile_name_first" -> [
        // 'profile',
        // 'profile.name',
        // 'profile.name.first'
        // ]
        const selectors = MergeTagValueResolver.normalizeSelectors('profile_name_first')
    • resolve: function
      • Resolve the display value for a merge-tag entry using the provided profile, falling back to the entry's configured nt_fallback when necessary.

        Parameters

        • mergeTagEntry:
              | {
                  fields: {
                      nt_fallback?: string;
                      nt_mergetag_id: string;
                      nt_name: string;
                  };
                  metadata: {
                      concepts?: {
                          sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                      }[];
                      tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                  };
                  sys: {
                      contentType: {
                          sys: { id: "nt_mergetag"; linkType: "ContentType"; type: "Link" };
                      };
                      createdAt: any;
                      environment: {
                          sys: { id: string; linkType: "Environment"; type: "Link" };
                      };
                      id: string;
                      locale?: string;
                      publishedVersion: number;
                      revision: number;
                      space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                      type: "Entry";
                      updatedAt: any;
                  };
              }
              | undefined

          The merge-tag entry to resolve.

          • {
                fields: {
                    nt_fallback?: string;
                    nt_mergetag_id: string;
                    nt_name: string;
                };
                metadata: {
                    concepts?: {
                        sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                    }[];
                    tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                };
                sys: {
                    contentType: {
                        sys: { id: "nt_mergetag"; linkType: "ContentType"; type: "Link" };
                    };
                    createdAt: any;
                    environment: {
                        sys: { id: string; linkType: "Environment"; type: "Link" };
                    };
                    id: string;
                    locale?: string;
                    publishedVersion: number;
                    revision: number;
                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                    type: "Entry";
                    updatedAt: any;
                };
            }
            • fields: { nt_fallback?: string; nt_mergetag_id: string; nt_name: string }
              • Optionalnt_fallback?: string

                Fallback value to use when the merge tag cannot be resolved.

              • nt_mergetag_id: string

                Internal identifier of the merge tag.

              • nt_name: string

                Human-readable name of the merge tag.

            • metadata: {
                  concepts?: {
                      sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                  }[];
                  tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
              }

              Contentful metadata, including tags.

            • sys: {
                  contentType: {
                      sys: { id: "nt_mergetag"; linkType: "ContentType"; type: "Link" };
                  };
                  createdAt: any;
                  environment: { sys: { id: string; linkType: "Environment"; type: "Link" } };
                  id: string;
                  locale?: string;
                  publishedVersion: number;
                  revision: number;
                  space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                  type: "Entry";
                  updatedAt: any;
              }

              System fields extended to constrain the content type to nt_mergetag.

          • undefined
        • Optionalprofile: {
              audiences: string[];
              id: string;
              location: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              };
              random: number;
              session: {
                  activeSessionLength: number;
                  averageSessionLength: number;
                  count: number;
                  id: string;
                  isReturningVisitor: boolean;
                  landingPage: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
              };
              stableId: string;
              traits: Record<string, JSONType>;
          }

          Optional profile used for lookup.

          • audiences: string[]

            List of audience identifiers that this profile currently belongs to.

          • id: string

            Primary identifier of the profile.

          • location: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            }

            Geo-location information associated with the profile.

            • Optionalcity?: string

              City name associated with the location.

            • Optionalcontinent?: string

              Continent name associated with the location.

            • Optionalcoordinates?: { latitude: number; longitude: number }

              Geographical coordinates for the location.

              • latitude: number

                Latitude component of the coordinates.

              • longitude: number

                Longitude component of the coordinates.

            • Optionalcountry?: string

              Country name associated with the location.

            • OptionalcountryCode?: string

              Country code associated with the location.

              Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

            • OptionalpostalCode?: string

              Postal or ZIP code associated with the location.

            • Optionalregion?: string

              Region or state name associated with the location.

            • OptionalregionCode?: string

              Region or state code associated with the location.

            • Optionaltimezone?: string

              Time zone identifier associated with the location.

              Typically an IANA time zone string (e.g., "Europe/Berlin").

          • random: number

            Random value associated with the profile.

            Often used for deterministic bucketing (e.g., in experiments).

          • session: {
                activeSessionLength: number;
                averageSessionLength: number;
                count: number;
                id: string;
                isReturningVisitor: boolean;
                landingPage: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
            }

            Aggregated session statistics for the profile.

            • activeSessionLength: number

              Duration of the active session.

            • averageSessionLength: number

              Average session duration across all sessions represented by this record.

              The unit should match SessionStatistics.activeSessionLength.

            • count: number

              Number of sessions associated with this profile or identifier.

              Often used in combination with SessionStatistics.averageSessionLength.

            • id: string

              Unique identifier for this session statistics record.

            • isReturningVisitor: boolean

              Indicates whether the visitor has been seen before.

              true typically means the visitor has at least one prior session.

            • landingPage: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }

              Landing page for the session.

              Represents the first page the user visited in this session.

              Page

              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

          • stableId: string

            Stable, long-lived identifier of the profile.

            Intended to remain constant across sessions and devices when possible. Usually equal to id.

          • traits: Record<string, JSONType>

            Traits describing the profile (user-level attributes).

            Traits

        Returns string | undefined

        The resolved string, or undefined if the entry is invalid and no fallback is available.

        const text = MergeTagValueResolver.resolve(entry, profile)
        render(text ?? 'Guest')
    optimizedEntryResolver: {
        resolve: {
            <
                S extends EntrySkeletonType = EntrySkeletonType,
                L extends string = string,
            >(
                entry: Entry<S, undefined, L>,
                selectedOptimizations?: {
                    experienceId: string;
                    sticky?: boolean;
                    variantIndex: number;
                    variants: Record<string, string>;
                }[],
            ): ResolvedData<S, undefined, L>;
            <
                S extends EntrySkeletonType,
                M extends ChainModifiers = ChainModifiers,
                L extends string = string,
            >(
                entry: Entry<S, M, L>,
                selectedOptimizations?: {
                    experienceId: string;
                    sticky?: boolean;
                    variantIndex: number;
                    variants: Record<string, string>;
                }[],
            ): ResolvedData<S, M, L>;
        };
        getOptimizationEntry(
            params: {
                optimizedEntry: {
                    fields: {
                        nt_experiences: (
                            | { sys: { id: string; linkType: string; type: "Link" } }
                            | {
                                fields: {
                                    nt_audience?:
                                        | {
                                            fields: {
                                                nt_audience_id: ...;
                                                nt_description?: ...;
                                                nt_name?: ...;
                                                [key: ...]: ...;
                                            };
                                            metadata: { concepts?: ...; tags: ... };
                                            sys: {
                                                contentType: ...;
                                                createdAt: ...;
                                                environment: ...;
                                                id: ...;
                                                locale?: ...;
                                                publishedVersion: ...;
                                                revision: ...;
                                                space: ...;
                                                type: ...;
                                                updatedAt: ...;
                                            };
                                        }
                                        | null;
                                    nt_config?: | {
                                        components?: (...)
                                        | (...);
                                        distribution?: (...) | (...);
                                        sticky?: (...) | (...) | (...);
                                        traffic?: (...) | (...);
                                    }
                                    | null;
                                    nt_description?: string
                                    | null;
                                    nt_experience_id: string;
                                    nt_name: string;
                                    nt_type: "nt_experiment" | "nt_personalization";
                                    nt_variants?: ((...) | (...))[];
                                    [key: string]: JSONType;
                                };
                                metadata: {
                                    concepts?: { sys: ... }[];
                                    tags: { sys: { id: ...; linkType: ...; type: ... } }[];
                                };
                                sys: {
                                    contentType: {
                                        sys: { id: string; linkType: "ContentType"; type: "Link" };
                                    };
                                    createdAt: any;
                                    environment: {
                                        sys: { id: string; linkType: "Environment"; type: "Link" };
                                    };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                        )[];
                        [key: string]: JSONType;
                    };
                    metadata: {
                        concepts?: {
                            sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                        }[];
                        tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                    };
                    sys: {
                        contentType: {
                            sys: { id: string; linkType: "ContentType"; type: "Link" };
                        };
                        createdAt: any;
                        environment: {
                            sys: { id: string; linkType: "Environment"; type: "Link" };
                        };
                        id: string;
                        locale?: string;
                        publishedVersion: number;
                        revision: number;
                        space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                        type: "Entry";
                        updatedAt: any;
                    };
                };
                selectedOptimizations: {
                    experienceId: string;
                    sticky?: boolean;
                    variantIndex: number;
                    variants: Record<string, string>;
                }[];
            },
            skipValidation?: boolean,
        ):
            | {
                fields: {
                    nt_audience?: | {
                        fields: {
                            nt_audience_id: string;
                            nt_description?: string;
                            nt_name?: string;
                            [key: string]: JSONType;
                        };
                        metadata: {
                            concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                            tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                        };
                        sys: {
                            contentType: {
                                sys: { id: string; linkType: "ContentType"; type: "Link" };
                            };
                            createdAt: any;
                            environment: {
                                sys: { id: string; linkType: "Environment"; type: "Link" };
                            };
                            id: string;
                            locale?: string;
                            publishedVersion: number;
                            revision: number;
                            space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                            type: "Entry";
                            updatedAt: any;
                        };
                    }
                    | null;
                    nt_config?: | {
                        components?: (
                            | {
                                baseline: { hidden?: ...; id: ... };
                                type?: (...) | (...);
                                variants: (...)[];
                            }
                            | {
                                baseline: { value: ... };
                                key: string;
                                type: "InlineVariable";
                                valueType: (...) | (...) | (...) | (...);
                                variants: (...)[];
                            }
                        )[];
                        distribution?: number[];
                        sticky?: boolean;
                        traffic?: number;
                    }
                    | null;
                    nt_description?: string
                    | null;
                    nt_experience_id: string;
                    nt_name: string;
                    nt_type: "nt_experiment" | "nt_personalization";
                    nt_variants?: (
                        | { sys: { id: string; linkType: string; type: "Link" } }
                        | {
                            fields: { [key: string]: JSONType };
                            metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                            sys: {
                                contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                createdAt: any;
                                environment: { sys: { id: ...; linkType: ...; type: ... } };
                                id: string;
                                locale?: string;
                                publishedVersion: number;
                                revision: number;
                                space: { sys: { id: ...; linkType: ...; type: ... } };
                                type: "Entry";
                                updatedAt: any;
                            };
                        }
                    )[];
                    [key: string]: JSONType;
                };
                metadata: {
                    concepts?: {
                        sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                    }[];
                    tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                };
                sys: {
                    contentType: {
                        sys: { id: string; linkType: "ContentType"; type: "Link" };
                    };
                    createdAt: any;
                    environment: {
                        sys: { id: string; linkType: "Environment"; type: "Link" };
                    };
                    id: string;
                    locale?: string;
                    publishedVersion: number;
                    revision: number;
                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                    type: "Entry";
                    updatedAt: any;
                };
            }
            | undefined;
        getSelectedOptimization(
            params: {
                optimizationEntry: {
                    fields: {
                        nt_audience?:
                            | {
                                fields: {
                                    nt_audience_id: string;
                                    nt_description?: string;
                                    nt_name?: string;
                                    [key: string]: JSONType;
                                };
                                metadata: {
                                    concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                                    tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                                };
                                sys: {
                                    contentType: {
                                        sys: { id: string; linkType: "ContentType"; type: "Link" };
                                    };
                                    createdAt: any;
                                    environment: {
                                        sys: { id: string; linkType: "Environment"; type: "Link" };
                                    };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                            | null;
                        nt_config?: | {
                            components?: (
                                | {
                                    baseline: { hidden?: ...; id: ... };
                                    type?: (...) | (...);
                                    variants: (...)[];
                                }
                                | {
                                    baseline: { value: ... };
                                    key: string;
                                    type: "InlineVariable";
                                    valueType: (...) | (...) | (...) | (...);
                                    variants: (...)[];
                                }
                            )[];
                            distribution?: number[];
                            sticky?: boolean;
                            traffic?: number;
                        }
                        | null;
                        nt_description?: string
                        | null;
                        nt_experience_id: string;
                        nt_name: string;
                        nt_type: "nt_experiment" | "nt_personalization";
                        nt_variants?: (
                            | { sys: { id: string; linkType: string; type: "Link" } }
                            | {
                                fields: { [key: string]: JSONType };
                                metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                                sys: {
                                    contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                    createdAt: any;
                                    environment: { sys: { id: ...; linkType: ...; type: ... } };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: ...; linkType: ...; type: ... } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                        )[];
                        [key: string]: JSONType;
                    };
                    metadata: {
                        concepts?: {
                            sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                        }[];
                        tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                    };
                    sys: {
                        contentType: {
                            sys: { id: string; linkType: "ContentType"; type: "Link" };
                        };
                        createdAt: any;
                        environment: {
                            sys: { id: string; linkType: "Environment"; type: "Link" };
                        };
                        id: string;
                        locale?: string;
                        publishedVersion: number;
                        revision: number;
                        space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                        type: "Entry";
                        updatedAt: any;
                    };
                };
                selectedOptimizations: {
                    experienceId: string;
                    sticky?: boolean;
                    variantIndex: number;
                    variants: Record<string, string>;
                }[];
            },
            skipValidation?: boolean,
        ):
            | {
                experienceId: string;
                sticky?: boolean;
                variantIndex: number;
                variants: Record<string, string>;
            }
            | undefined;
        getSelectedVariant(
            params: {
                optimizationEntry: {
                    fields: {
                        nt_audience?:
                            | {
                                fields: {
                                    nt_audience_id: string;
                                    nt_description?: string;
                                    nt_name?: string;
                                    [key: string]: JSONType;
                                };
                                metadata: {
                                    concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                                    tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                                };
                                sys: {
                                    contentType: {
                                        sys: { id: string; linkType: "ContentType"; type: "Link" };
                                    };
                                    createdAt: any;
                                    environment: {
                                        sys: { id: string; linkType: "Environment"; type: "Link" };
                                    };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                            | null;
                        nt_config?: | {
                            components?: (
                                | {
                                    baseline: { hidden?: ...; id: ... };
                                    type?: (...) | (...);
                                    variants: (...)[];
                                }
                                | {
                                    baseline: { value: ... };
                                    key: string;
                                    type: "InlineVariable";
                                    valueType: (...) | (...) | (...) | (...);
                                    variants: (...)[];
                                }
                            )[];
                            distribution?: number[];
                            sticky?: boolean;
                            traffic?: number;
                        }
                        | null;
                        nt_description?: string
                        | null;
                        nt_experience_id: string;
                        nt_name: string;
                        nt_type: "nt_experiment" | "nt_personalization";
                        nt_variants?: (
                            | { sys: { id: string; linkType: string; type: "Link" } }
                            | {
                                fields: { [key: string]: JSONType };
                                metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                                sys: {
                                    contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                    createdAt: any;
                                    environment: { sys: { id: ...; linkType: ...; type: ... } };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: ...; linkType: ...; type: ... } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                        )[];
                        [key: string]: JSONType;
                    };
                    metadata: {
                        concepts?: {
                            sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                        }[];
                        tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                    };
                    sys: {
                        contentType: {
                            sys: { id: string; linkType: "ContentType"; type: "Link" };
                        };
                        createdAt: any;
                        environment: {
                            sys: { id: string; linkType: "Environment"; type: "Link" };
                        };
                        id: string;
                        locale?: string;
                        publishedVersion: number;
                        revision: number;
                        space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                        type: "Entry";
                        updatedAt: any;
                    };
                };
                optimizedEntry: {
                    fields: {
                        nt_experiences: (
                            | { sys: { id: string; linkType: string; type: "Link" } }
                            | {
                                fields: {
                                    nt_audience?:
                                        | {
                                            fields: {
                                                nt_audience_id: ...;
                                                nt_description?: ...;
                                                nt_name?: ...;
                                                [key: ...]: ...;
                                            };
                                            metadata: { concepts?: ...; tags: ... };
                                            sys: {
                                                contentType: ...;
                                                createdAt: ...;
                                                environment: ...;
                                                id: ...;
                                                locale?: ...;
                                                publishedVersion: ...;
                                                revision: ...;
                                                space: ...;
                                                type: ...;
                                                updatedAt: ...;
                                            };
                                        }
                                        | null;
                                    nt_config?: | {
                                        components?: (...)
                                        | (...);
                                        distribution?: (...) | (...);
                                        sticky?: (...) | (...) | (...);
                                        traffic?: (...) | (...);
                                    }
                                    | null;
                                    nt_description?: string
                                    | null;
                                    nt_experience_id: string;
                                    nt_name: string;
                                    nt_type: "nt_experiment" | "nt_personalization";
                                    nt_variants?: ((...) | (...))[];
                                    [key: string]: JSONType;
                                };
                                metadata: {
                                    concepts?: { sys: ... }[];
                                    tags: { sys: { id: ...; linkType: ...; type: ... } }[];
                                };
                                sys: {
                                    contentType: {
                                        sys: { id: string; linkType: "ContentType"; type: "Link" };
                                    };
                                    createdAt: any;
                                    environment: {
                                        sys: { id: string; linkType: "Environment"; type: "Link" };
                                    };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                        )[];
                        [key: string]: JSONType;
                    };
                    metadata: {
                        concepts?: {
                            sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                        }[];
                        tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                    };
                    sys: {
                        contentType: {
                            sys: { id: string; linkType: "ContentType"; type: "Link" };
                        };
                        createdAt: any;
                        environment: {
                            sys: { id: string; linkType: "Environment"; type: "Link" };
                        };
                        id: string;
                        locale?: string;
                        publishedVersion: number;
                        revision: number;
                        space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                        type: "Entry";
                        updatedAt: any;
                    };
                };
                selectedVariantIndex: number;
            },
            skipValidation?: boolean,
        ): { hidden?: boolean; id: string } | undefined;
        getSelectedVariantEntry<
            S extends EntrySkeletonType,
            M extends ChainModifiers = ChainModifiers,
            L extends string = string,
        >(
            params: {
                optimizationEntry: {
                    fields: {
                        nt_audience?:
                            | {
                                fields: {
                                    nt_audience_id: string;
                                    nt_description?: string;
                                    nt_name?: string;
                                    [key: string]: JSONType;
                                };
                                metadata: {
                                    concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                                    tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                                };
                                sys: {
                                    contentType: {
                                        sys: { id: string; linkType: "ContentType"; type: "Link" };
                                    };
                                    createdAt: any;
                                    environment: {
                                        sys: { id: string; linkType: "Environment"; type: "Link" };
                                    };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                            | null;
                        nt_config?: | {
                            components?: (
                                | {
                                    baseline: { hidden?: ...; id: ... };
                                    type?: (...) | (...);
                                    variants: (...)[];
                                }
                                | {
                                    baseline: { value: ... };
                                    key: string;
                                    type: "InlineVariable";
                                    valueType: (...) | (...) | (...) | (...);
                                    variants: (...)[];
                                }
                            )[];
                            distribution?: number[];
                            sticky?: boolean;
                            traffic?: number;
                        }
                        | null;
                        nt_description?: string
                        | null;
                        nt_experience_id: string;
                        nt_name: string;
                        nt_type: "nt_experiment" | "nt_personalization";
                        nt_variants?: (
                            | { sys: { id: string; linkType: string; type: "Link" } }
                            | {
                                fields: { [key: string]: JSONType };
                                metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                                sys: {
                                    contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                    createdAt: any;
                                    environment: { sys: { id: ...; linkType: ...; type: ... } };
                                    id: string;
                                    locale?: string;
                                    publishedVersion: number;
                                    revision: number;
                                    space: { sys: { id: ...; linkType: ...; type: ... } };
                                    type: "Entry";
                                    updatedAt: any;
                                };
                            }
                        )[];
                        [key: string]: JSONType;
                    };
                    metadata: {
                        concepts?: {
                            sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                        }[];
                        tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                    };
                    sys: {
                        contentType: {
                            sys: { id: string; linkType: "ContentType"; type: "Link" };
                        };
                        createdAt: any;
                        environment: {
                            sys: { id: string; linkType: "Environment"; type: "Link" };
                        };
                        id: string;
                        locale?: string;
                        publishedVersion: number;
                        revision: number;
                        space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                        type: "Entry";
                        updatedAt: any;
                    };
                };
                selectedVariant: { hidden?: boolean; id: string };
            },
            skipValidation?: boolean,
        ): Entry<S, M, L> | undefined;
    } = OptimizedEntryResolver

    Static resolver for optimized Contentful entries.

    Type Declaration

    • resolve: {
          <
              S extends EntrySkeletonType = EntrySkeletonType,
              L extends string = string,
          >(
              entry: Entry<S, undefined, L>,
              selectedOptimizations?: {
                  experienceId: string;
                  sticky?: boolean;
                  variantIndex: number;
                  variants: Record<string, string>;
              }[],
          ): ResolvedData<S, undefined, L>;
          <
              S extends EntrySkeletonType,
              M extends ChainModifiers = ChainModifiers,
              L extends string = string,
          >(
              entry: Entry<S, M, L>,
              selectedOptimizations?: {
                  experienceId: string;
                  sticky?: boolean;
                  variantIndex: number;
                  variants: Record<string, string>;
              }[],
          ): ResolvedData<S, M, L>;
      }
    • getOptimizationEntry: function
      • Find the optimization entry corresponding to one of the selected experiences.

        Parameters

        • params: {
              optimizedEntry: {
                  fields: {
                      nt_experiences: (
                          | { sys: { id: string; linkType: string; type: "Link" } }
                          | {
                              fields: {
                                  nt_audience?:
                                      | {
                                          fields: {
                                              nt_audience_id: ...;
                                              nt_description?: ...;
                                              nt_name?: ...;
                                              [key: ...]: ...;
                                          };
                                          metadata: { concepts?: ...; tags: ... };
                                          sys: {
                                              contentType: ...;
                                              createdAt: ...;
                                              environment: ...;
                                              id: ...;
                                              locale?: ...;
                                              publishedVersion: ...;
                                              revision: ...;
                                              space: ...;
                                              type: ...;
                                              updatedAt: ...;
                                          };
                                      }
                                      | null;
                                  nt_config?: | {
                                      components?: (...)
                                      | (...);
                                      distribution?: (...) | (...);
                                      sticky?: (...) | (...) | (...);
                                      traffic?: (...) | (...);
                                  }
                                  | null;
                                  nt_description?: string
                                  | null;
                                  nt_experience_id: string;
                                  nt_name: string;
                                  nt_type: "nt_experiment" | "nt_personalization";
                                  nt_variants?: ((...) | (...))[];
                                  [key: string]: JSONType;
                              };
                              metadata: {
                                  concepts?: { sys: ... }[];
                                  tags: { sys: { id: ...; linkType: ...; type: ... } }[];
                              };
                              sys: {
                                  contentType: {
                                      sys: { id: string; linkType: "ContentType"; type: "Link" };
                                  };
                                  createdAt: any;
                                  environment: {
                                      sys: { id: string; linkType: "Environment"; type: "Link" };
                                  };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                      )[];
                      [key: string]: JSONType;
                  };
                  metadata: {
                      concepts?: {
                          sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                      }[];
                      tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                  };
                  sys: {
                      contentType: {
                          sys: { id: string; linkType: "ContentType"; type: "Link" };
                      };
                      createdAt: any;
                      environment: {
                          sys: { id: string; linkType: "Environment"; type: "Link" };
                      };
                      id: string;
                      locale?: string;
                      publishedVersion: number;
                      revision: number;
                      space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                      type: "Entry";
                      updatedAt: any;
                  };
              };
              selectedOptimizations: {
                  experienceId: string;
                  sticky?: boolean;
                  variantIndex: number;
                  variants: Record<string, string>;
              }[];
          }

          Object containing the baseline optimized entry and the selections.

        • skipValidation: boolean = false

          When true, skip type/shape validation for perf.

        Returns
            | {
                fields: {
                    nt_audience?: | {
                        fields: {
                            nt_audience_id: string;
                            nt_description?: string;
                            nt_name?: string;
                            [key: string]: JSONType;
                        };
                        metadata: {
                            concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                            tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                        };
                        sys: {
                            contentType: {
                                sys: { id: string; linkType: "ContentType"; type: "Link" };
                            };
                            createdAt: any;
                            environment: {
                                sys: { id: string; linkType: "Environment"; type: "Link" };
                            };
                            id: string;
                            locale?: string;
                            publishedVersion: number;
                            revision: number;
                            space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                            type: "Entry";
                            updatedAt: any;
                        };
                    }
                    | null;
                    nt_config?: | {
                        components?: (
                            | {
                                baseline: { hidden?: ...; id: ... };
                                type?: (...) | (...);
                                variants: (...)[];
                            }
                            | {
                                baseline: { value: ... };
                                key: string;
                                type: "InlineVariable";
                                valueType: (...) | (...) | (...) | (...);
                                variants: (...)[];
                            }
                        )[];
                        distribution?: number[];
                        sticky?: boolean;
                        traffic?: number;
                    }
                    | null;
                    nt_description?: string
                    | null;
                    nt_experience_id: string;
                    nt_name: string;
                    nt_type: "nt_experiment" | "nt_personalization";
                    nt_variants?: (
                        | { sys: { id: string; linkType: string; type: "Link" } }
                        | {
                            fields: { [key: string]: JSONType };
                            metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                            sys: {
                                contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                createdAt: any;
                                environment: { sys: { id: ...; linkType: ...; type: ... } };
                                id: string;
                                locale?: string;
                                publishedVersion: number;
                                revision: number;
                                space: { sys: { id: ...; linkType: ...; type: ... } };
                                type: "Entry";
                                updatedAt: any;
                            };
                        }
                    )[];
                    [key: string]: JSONType;
                };
                metadata: {
                    concepts?: {
                        sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                    }[];
                    tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                };
                sys: {
                    contentType: {
                        sys: { id: string; linkType: "ContentType"; type: "Link" };
                    };
                    createdAt: any;
                    environment: {
                        sys: { id: string; linkType: "Environment"; type: "Link" };
                    };
                    id: string;
                    locale?: string;
                    publishedVersion: number;
                    revision: number;
                    space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                    type: "Entry";
                    updatedAt: any;
                };
            }
            | undefined

        The matching OptimizationEntry, or undefined if not found/invalid.

        • {
              fields: {
                  nt_audience?:
                      | {
                          fields: {
                              nt_audience_id: string;
                              nt_description?: string;
                              nt_name?: string;
                              [key: string]: JSONType;
                          };
                          metadata: {
                              concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                              tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                          };
                          sys: {
                              contentType: {
                                  sys: { id: string; linkType: "ContentType"; type: "Link" };
                              };
                              createdAt: any;
                              environment: {
                                  sys: { id: string; linkType: "Environment"; type: "Link" };
                              };
                              id: string;
                              locale?: string;
                              publishedVersion: number;
                              revision: number;
                              space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                              type: "Entry";
                              updatedAt: any;
                          };
                      }
                      | null;
                  nt_config?: | {
                      components?: (
                          | {
                              baseline: { hidden?: ...; id: ... };
                              type?: (...) | (...);
                              variants: (...)[];
                          }
                          | {
                              baseline: { value: ... };
                              key: string;
                              type: "InlineVariable";
                              valueType: (...) | (...) | (...) | (...);
                              variants: (...)[];
                          }
                      )[];
                      distribution?: number[];
                      sticky?: boolean;
                      traffic?: number;
                  }
                  | null;
                  nt_description?: string
                  | null;
                  nt_experience_id: string;
                  nt_name: string;
                  nt_type: "nt_experiment" | "nt_personalization";
                  nt_variants?: (
                      | { sys: { id: string; linkType: string; type: "Link" } }
                      | {
                          fields: { [key: string]: JSONType };
                          metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                          sys: {
                              contentType: { sys: { id: ...; linkType: ...; type: ... } };
                              createdAt: any;
                              environment: { sys: { id: ...; linkType: ...; type: ... } };
                              id: string;
                              locale?: string;
                              publishedVersion: number;
                              revision: number;
                              space: { sys: { id: ...; linkType: ...; type: ... } };
                              type: "Entry";
                              updatedAt: any;
                          };
                      }
                  )[];
                  [key: string]: JSONType;
              };
              metadata: {
                  concepts?: {
                      sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                  }[];
                  tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
              };
              sys: {
                  contentType: {
                      sys: { id: string; linkType: "ContentType"; type: "Link" };
                  };
                  createdAt: any;
                  environment: {
                      sys: { id: string; linkType: "Environment"; type: "Link" };
                  };
                  id: string;
                  locale?: string;
                  publishedVersion: number;
                  revision: number;
                  space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                  type: "Entry";
                  updatedAt: any;
              };
          }
          • fields: {
                nt_audience?:
                    | {
                        fields: {
                            nt_audience_id: string;
                            nt_description?: string;
                            nt_name?: string;
                            [key: string]: JSONType;
                        };
                        metadata: {
                            concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                            tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                        };
                        sys: {
                            contentType: {
                                sys: { id: string; linkType: "ContentType"; type: "Link" };
                            };
                            createdAt: any;
                            environment: {
                                sys: { id: string; linkType: "Environment"; type: "Link" };
                            };
                            id: string;
                            locale?: string;
                            publishedVersion: number;
                            revision: number;
                            space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                            type: "Entry";
                            updatedAt: any;
                        };
                    }
                    | null;
                nt_config?: | {
                    components?: (
                        | {
                            baseline: { hidden?: ...; id: ... };
                            type?: (...) | (...);
                            variants: (...)[];
                        }
                        | {
                            baseline: { value: ... };
                            key: string;
                            type: "InlineVariable";
                            valueType: (...) | (...) | (...) | (...);
                            variants: (...)[];
                        }
                    )[];
                    distribution?: number[];
                    sticky?: boolean;
                    traffic?: number;
                }
                | null;
                nt_description?: string
                | null;
                nt_experience_id: string;
                nt_name: string;
                nt_type: "nt_experiment" | "nt_personalization";
                nt_variants?: (
                    | { sys: { id: string; linkType: string; type: "Link" } }
                    | {
                        fields: { [key: string]: JSONType };
                        metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                        sys: {
                            contentType: { sys: { id: ...; linkType: ...; type: ... } };
                            createdAt: any;
                            environment: { sys: { id: ...; linkType: ...; type: ... } };
                            id: string;
                            locale?: string;
                            publishedVersion: number;
                            revision: number;
                            space: { sys: { id: ...; linkType: ...; type: ... } };
                            type: "Entry";
                            updatedAt: any;
                        };
                    }
                )[];
                [key: string]: JSONType;
            }
            • Optionalnt_audience?:
                  | {
                      fields: {
                          nt_audience_id: string;
                          nt_description?: string;
                          nt_name?: string;
                          [key: string]: JSONType;
                      };
                      metadata: {
                          concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                          tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                      };
                      sys: {
                          contentType: {
                              sys: { id: string; linkType: "ContentType"; type: "Link" };
                          };
                          createdAt: any;
                          environment: {
                              sys: { id: string; linkType: "Environment"; type: "Link" };
                          };
                          id: string;
                          locale?: string;
                          publishedVersion: number;
                          revision: number;
                          space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                          type: "Entry";
                          updatedAt: any;
                      };
                  }
                  | null

              The audience of the optimization (Audience).

              Optional and nullable; when omitted or null, the optimization may apply to all users.

            • Optionalnt_config?:
                  | {
                      components?: (
                          | {
                              baseline: { hidden?: ...; id: ... };
                              type?: (...) | (...);
                              variants: (...)[];
                          }
                          | {
                              baseline: { value: ... };
                              key: string;
                              type: "InlineVariable";
                              valueType: (...) | (...) | (...) | (...);
                              variants: (...)[];
                          }
                      )[];
                      distribution?: number[];
                      sticky?: boolean;
                      traffic?: number;
                  }
                  | null

              The configuration of an OptimizationEntry (JSON).

            • Optionalnt_description?: string | null

              The description of the optimization (Short Text).

              Optional, may be null if no description is provided.

            • nt_experience_id: string

              The optimization/experience ID related to this optimization entry.

            • nt_name: string

              The name of the optimization (Short Text).

            • nt_type: "nt_experiment" | "nt_personalization"

              The type of the optimization (nt_experiment | nt_personalization).

            • Optionalnt_variants?: (
                  | { sys: { id: string; linkType: string; type: "Link" } }
                  | {
                      fields: { [key: string]: JSONType };
                      metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                      sys: {
                          contentType: { sys: { id: ...; linkType: ...; type: ... } };
                          createdAt: any;
                          environment: { sys: { id: ...; linkType: ...; type: ... } };
                          id: string;
                          locale?: string;
                          publishedVersion: number;
                          revision: number;
                          space: { sys: { id: ...; linkType: ...; type: ... } };
                          type: "Entry";
                          updatedAt: any;
                      };
                  }
              )[]

              All used variants of the optimization (Contentful references to other Content Types).

              Modeled as an array of Contentful links or resolved entries.

          • metadata: {
                concepts?: {
                    sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                }[];
                tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
            }

            Contentful metadata, including tags.

          • sys: {
                contentType: {
                    sys: { id: string; linkType: "ContentType"; type: "Link" };
                };
                createdAt: any;
                environment: { sys: { id: string; linkType: "Environment"; type: "Link" } };
                id: string;
                locale?: string;
                publishedVersion: number;
                revision: number;
                space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                type: "Entry";
                updatedAt: any;
            }

            System-managed properties describing the entry.

        • undefined

        An optimization entry is an optimization configuration object supplied in an OptimizedEntry.nt_experiences array. An optimized entry may relate to multiple optimizations.

        const optimizationEntry = OptimizedEntryResolver.getOptimizationEntry({
        optimizedEntry: entry,
        selectedOptimizations
        })
    • getSelectedOptimization: function
      • Look up the selection metadata for a specific optimization entry.

        Parameters

        • params: {
              optimizationEntry: {
                  fields: {
                      nt_audience?:
                          | {
                              fields: {
                                  nt_audience_id: string;
                                  nt_description?: string;
                                  nt_name?: string;
                                  [key: string]: JSONType;
                              };
                              metadata: {
                                  concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                                  tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                              };
                              sys: {
                                  contentType: {
                                      sys: { id: string; linkType: "ContentType"; type: "Link" };
                                  };
                                  createdAt: any;
                                  environment: {
                                      sys: { id: string; linkType: "Environment"; type: "Link" };
                                  };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                          | null;
                      nt_config?: | {
                          components?: (
                              | {
                                  baseline: { hidden?: ...; id: ... };
                                  type?: (...) | (...);
                                  variants: (...)[];
                              }
                              | {
                                  baseline: { value: ... };
                                  key: string;
                                  type: "InlineVariable";
                                  valueType: (...) | (...) | (...) | (...);
                                  variants: (...)[];
                              }
                          )[];
                          distribution?: number[];
                          sticky?: boolean;
                          traffic?: number;
                      }
                      | null;
                      nt_description?: string
                      | null;
                      nt_experience_id: string;
                      nt_name: string;
                      nt_type: "nt_experiment" | "nt_personalization";
                      nt_variants?: (
                          | { sys: { id: string; linkType: string; type: "Link" } }
                          | {
                              fields: { [key: string]: JSONType };
                              metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                              sys: {
                                  contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                  createdAt: any;
                                  environment: { sys: { id: ...; linkType: ...; type: ... } };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: ...; linkType: ...; type: ... } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                      )[];
                      [key: string]: JSONType;
                  };
                  metadata: {
                      concepts?: {
                          sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                      }[];
                      tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                  };
                  sys: {
                      contentType: {
                          sys: { id: string; linkType: "ContentType"; type: "Link" };
                      };
                      createdAt: any;
                      environment: {
                          sys: { id: string; linkType: "Environment"; type: "Link" };
                      };
                      id: string;
                      locale?: string;
                      publishedVersion: number;
                      revision: number;
                      space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                      type: "Entry";
                      updatedAt: any;
                  };
              };
              selectedOptimizations: {
                  experienceId: string;
                  sticky?: boolean;
                  variantIndex: number;
                  variants: Record<string, string>;
              }[];
          }

          Object with the target optimization entry and selections.

        • skipValidation: boolean = false

          When true, skip type checks.

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

        The matching SelectedOptimization, if present.

        • {
              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
            

            Sticky selections should be reused 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

        Selected optimizations are supplied by the Experience API in the experiences response data property.

        const selectedOptimization = OptimizedEntryResolver.getSelectedOptimization({
        optimizationEntry,
        selectedOptimizations
        })
    • getSelectedVariant: function
      • Get the replacement variant config for the given selection index.

        Parameters

        • params: {
              optimizationEntry: {
                  fields: {
                      nt_audience?:
                          | {
                              fields: {
                                  nt_audience_id: string;
                                  nt_description?: string;
                                  nt_name?: string;
                                  [key: string]: JSONType;
                              };
                              metadata: {
                                  concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                                  tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                              };
                              sys: {
                                  contentType: {
                                      sys: { id: string; linkType: "ContentType"; type: "Link" };
                                  };
                                  createdAt: any;
                                  environment: {
                                      sys: { id: string; linkType: "Environment"; type: "Link" };
                                  };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                          | null;
                      nt_config?: | {
                          components?: (
                              | {
                                  baseline: { hidden?: ...; id: ... };
                                  type?: (...) | (...);
                                  variants: (...)[];
                              }
                              | {
                                  baseline: { value: ... };
                                  key: string;
                                  type: "InlineVariable";
                                  valueType: (...) | (...) | (...) | (...);
                                  variants: (...)[];
                              }
                          )[];
                          distribution?: number[];
                          sticky?: boolean;
                          traffic?: number;
                      }
                      | null;
                      nt_description?: string
                      | null;
                      nt_experience_id: string;
                      nt_name: string;
                      nt_type: "nt_experiment" | "nt_personalization";
                      nt_variants?: (
                          | { sys: { id: string; linkType: string; type: "Link" } }
                          | {
                              fields: { [key: string]: JSONType };
                              metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                              sys: {
                                  contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                  createdAt: any;
                                  environment: { sys: { id: ...; linkType: ...; type: ... } };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: ...; linkType: ...; type: ... } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                      )[];
                      [key: string]: JSONType;
                  };
                  metadata: {
                      concepts?: {
                          sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                      }[];
                      tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                  };
                  sys: {
                      contentType: {
                          sys: { id: string; linkType: "ContentType"; type: "Link" };
                      };
                      createdAt: any;
                      environment: {
                          sys: { id: string; linkType: "Environment"; type: "Link" };
                      };
                      id: string;
                      locale?: string;
                      publishedVersion: number;
                      revision: number;
                      space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                      type: "Entry";
                      updatedAt: any;
                  };
              };
              optimizedEntry: {
                  fields: {
                      nt_experiences: (
                          | { sys: { id: string; linkType: string; type: "Link" } }
                          | {
                              fields: {
                                  nt_audience?:
                                      | {
                                          fields: {
                                              nt_audience_id: ...;
                                              nt_description?: ...;
                                              nt_name?: ...;
                                              [key: ...]: ...;
                                          };
                                          metadata: { concepts?: ...; tags: ... };
                                          sys: {
                                              contentType: ...;
                                              createdAt: ...;
                                              environment: ...;
                                              id: ...;
                                              locale?: ...;
                                              publishedVersion: ...;
                                              revision: ...;
                                              space: ...;
                                              type: ...;
                                              updatedAt: ...;
                                          };
                                      }
                                      | null;
                                  nt_config?: | {
                                      components?: (...)
                                      | (...);
                                      distribution?: (...) | (...);
                                      sticky?: (...) | (...) | (...);
                                      traffic?: (...) | (...);
                                  }
                                  | null;
                                  nt_description?: string
                                  | null;
                                  nt_experience_id: string;
                                  nt_name: string;
                                  nt_type: "nt_experiment" | "nt_personalization";
                                  nt_variants?: ((...) | (...))[];
                                  [key: string]: JSONType;
                              };
                              metadata: {
                                  concepts?: { sys: ... }[];
                                  tags: { sys: { id: ...; linkType: ...; type: ... } }[];
                              };
                              sys: {
                                  contentType: {
                                      sys: { id: string; linkType: "ContentType"; type: "Link" };
                                  };
                                  createdAt: any;
                                  environment: {
                                      sys: { id: string; linkType: "Environment"; type: "Link" };
                                  };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                      )[];
                      [key: string]: JSONType;
                  };
                  metadata: {
                      concepts?: {
                          sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                      }[];
                      tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                  };
                  sys: {
                      contentType: {
                          sys: { id: string; linkType: "ContentType"; type: "Link" };
                      };
                      createdAt: any;
                      environment: {
                          sys: { id: string; linkType: "Environment"; type: "Link" };
                      };
                      id: string;
                      locale?: string;
                      publishedVersion: number;
                      revision: number;
                      space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                      type: "Entry";
                      updatedAt: any;
                  };
              };
              selectedVariantIndex: number;
          }

          Baseline entry, optimization entry, and 1‑based variant index.

        • skipValidation: boolean = false

          When true, skip type checks.

        Returns { hidden?: boolean; id: string } | undefined

        The EntryReplacementVariant for the component, if any.

        • { hidden?: boolean; id: string }
          • Optionalhidden?: boolean

            Indicates whether this variant is hidden from allocation/traffic.

          • id: string

            Unique identifier for the variant.

        • undefined

        Entry replacement variants are variant configurations specified in a optimization configuration component's variants array supplied by the optimized entry via its nt_config field.

        const selectedVariant = OptimizedEntryResolver.getSelectedVariant({
        optimizedEntry: entry,
        optimizationEntry,
        selectedVariantIndex: 2 // second variant (1‑based)
        })
    • getSelectedVariantEntry: function
      • Resolve the concrete Contentful entry that corresponds to a selected variant.

        Type Parameters

        • S extends EntrySkeletonType

          Entry skeleton type.

        • M extends ChainModifiers = ChainModifiers

          Chain modifiers.

        • L extends string = string

          Locale code.

        Parameters

        • params: {
              optimizationEntry: {
                  fields: {
                      nt_audience?:
                          | {
                              fields: {
                                  nt_audience_id: string;
                                  nt_description?: string;
                                  nt_name?: string;
                                  [key: string]: JSONType;
                              };
                              metadata: {
                                  concepts?: { sys: { id: ...; linkType: ...; type: ... } }[];
                                  tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                              };
                              sys: {
                                  contentType: {
                                      sys: { id: string; linkType: "ContentType"; type: "Link" };
                                  };
                                  createdAt: any;
                                  environment: {
                                      sys: { id: string; linkType: "Environment"; type: "Link" };
                                  };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                          | null;
                      nt_config?: | {
                          components?: (
                              | {
                                  baseline: { hidden?: ...; id: ... };
                                  type?: (...) | (...);
                                  variants: (...)[];
                              }
                              | {
                                  baseline: { value: ... };
                                  key: string;
                                  type: "InlineVariable";
                                  valueType: (...) | (...) | (...) | (...);
                                  variants: (...)[];
                              }
                          )[];
                          distribution?: number[];
                          sticky?: boolean;
                          traffic?: number;
                      }
                      | null;
                      nt_description?: string
                      | null;
                      nt_experience_id: string;
                      nt_name: string;
                      nt_type: "nt_experiment" | "nt_personalization";
                      nt_variants?: (
                          | { sys: { id: string; linkType: string; type: "Link" } }
                          | {
                              fields: { [key: string]: JSONType };
                              metadata: { concepts?: (...)[]; tags: { sys: ... }[] };
                              sys: {
                                  contentType: { sys: { id: ...; linkType: ...; type: ... } };
                                  createdAt: any;
                                  environment: { sys: { id: ...; linkType: ...; type: ... } };
                                  id: string;
                                  locale?: string;
                                  publishedVersion: number;
                                  revision: number;
                                  space: { sys: { id: ...; linkType: ...; type: ... } };
                                  type: "Entry";
                                  updatedAt: any;
                              };
                          }
                      )[];
                      [key: string]: JSONType;
                  };
                  metadata: {
                      concepts?: {
                          sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                      }[];
                      tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
                  };
                  sys: {
                      contentType: {
                          sys: { id: string; linkType: "ContentType"; type: "Link" };
                      };
                      createdAt: any;
                      environment: {
                          sys: { id: string; linkType: "Environment"; type: "Link" };
                      };
                      id: string;
                      locale?: string;
                      publishedVersion: number;
                      revision: number;
                      space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                      type: "Entry";
                      updatedAt: any;
                  };
              };
              selectedVariant: { hidden?: boolean; id: string };
          }

          Optimization entry and selected variant.

        • skipValidation: boolean = false

          When true, skip type checks.

        Returns Entry<S, M, L> | undefined

        The resolved entry typed as Entry or undefined.

        An optimized entry will resolve either to the baseline (the entry supplied as optimizedEntry) or the selected variant.

        const selectedVariantEntry = OptimizedEntryResolver.getSelectedVariantEntry<{ fields: unknown }>({
        optimizationEntry,
        selectedVariant
        })

    Methods

    • Get the value of a custom flag derived from a set of optimization changes.

      Parameters

      • name: string

        The flag key to resolve.

      • Optionalchanges: {
            key: string;
            meta: { experienceId: string; variantIndex: number };
            type: "Variable";
            value: string | number | boolean | Record<string, JSONType> | null;
        }[]

        Optional change list to resolve from.

        • key: string

          Key identifying the subject of the change.

        • meta: { experienceId: string; variantIndex: number }

          Metadata describing the originating experience and variant index.

          • experienceId: string

            Identifier of the personalization or experiment experience.

          • variantIndex: number

            Index of the variant within the experience configuration.

            Typically corresponds to the array index in the experience's distribution.

        • type: "Variable"

          Discriminator for a variable change.

        • value: string | number | boolean | Record<string, JSONType> | null

          New value for the variable identified by ChangeBase.key.

      Returns unknown

      The resolved JSON value for the flag if available.

      This is a convenience wrapper around Core's shared flag resolution.

      const darkMode = core.getFlag('dark-mode', data.changes)
      
    • Resolve a merge-tag value from the given entry node and profile.

      Parameters

      • embeddedEntryNodeTarget: {
            fields: {
                nt_fallback?: string;
                nt_mergetag_id: string;
                nt_name: string;
            };
            metadata: {
                concepts?: {
                    sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
                }[];
                tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
            };
            sys: {
                contentType: {
                    sys: { id: "nt_mergetag"; linkType: "ContentType"; type: "Link" };
                };
                createdAt: any;
                environment: {
                    sys: { id: string; linkType: "Environment"; type: "Link" };
                };
                id: string;
                locale?: string;
                publishedVersion: number;
                revision: number;
                space: { sys: { id: string; linkType: "Space"; type: "Link" } };
                type: "Entry";
                updatedAt: any;
            };
        }

        The merge-tag entry node to resolve.

        • fields: { nt_fallback?: string; nt_mergetag_id: string; nt_name: string }
          • Optionalnt_fallback?: string

            Fallback value to use when the merge tag cannot be resolved.

          • nt_mergetag_id: string

            Internal identifier of the merge tag.

          • nt_name: string

            Human-readable name of the merge tag.

        • metadata: {
              concepts?: {
                  sys: { id: string; linkType: "TaxonomyConcept"; type: "Link" };
              }[];
              tags: { sys: { id: string; linkType: "Tag"; type: "Link" } }[];
          }

          Contentful metadata, including tags.

        • sys: {
              contentType: {
                  sys: { id: "nt_mergetag"; linkType: "ContentType"; type: "Link" };
              };
              createdAt: any;
              environment: { sys: { id: string; linkType: "Environment"; type: "Link" } };
              id: string;
              locale?: string;
              publishedVersion: number;
              revision: number;
              space: { sys: { id: string; linkType: "Space"; type: "Link" } };
              type: "Entry";
              updatedAt: any;
          }

          System fields extended to constrain the content type to nt_mergetag.

      • Optionalprofile: {
            audiences: string[];
            id: string;
            location: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            random: number;
            session: {
                activeSessionLength: number;
                averageSessionLength: number;
                count: number;
                id: string;
                isReturningVisitor: boolean;
                landingPage: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
            };
            stableId: string;
            traits: Record<string, JSONType>;
        }

        Optional profile used for value lookup.

        • audiences: string[]

          List of audience identifiers that this profile currently belongs to.

        • id: string

          Primary identifier of the profile.

        • location: {
              city?: string;
              continent?: string;
              coordinates?: { latitude: number; longitude: number };
              country?: string;
              countryCode?: string;
              postalCode?: string;
              region?: string;
              regionCode?: string;
              timezone?: string;
          }

          Geo-location information associated with the profile.

          • Optionalcity?: string

            City name associated with the location.

          • Optionalcontinent?: string

            Continent name associated with the location.

          • Optionalcoordinates?: { latitude: number; longitude: number }

            Geographical coordinates for the location.

            • latitude: number

              Latitude component of the coordinates.

            • longitude: number

              Longitude component of the coordinates.

          • Optionalcountry?: string

            Country name associated with the location.

          • OptionalcountryCode?: string

            Country code associated with the location.

            Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

          • OptionalpostalCode?: string

            Postal or ZIP code associated with the location.

          • Optionalregion?: string

            Region or state name associated with the location.

          • OptionalregionCode?: string

            Region or state code associated with the location.

          • Optionaltimezone?: string

            Time zone identifier associated with the location.

            Typically an IANA time zone string (e.g., "Europe/Berlin").

        • random: number

          Random value associated with the profile.

          Often used for deterministic bucketing (e.g., in experiments).

        • session: {
              activeSessionLength: number;
              averageSessionLength: number;
              count: number;
              id: string;
              isReturningVisitor: boolean;
              landingPage: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              };
          }

          Aggregated session statistics for the profile.

          • activeSessionLength: number

            Duration of the active session.

          • averageSessionLength: number

            Average session duration across all sessions represented by this record.

            The unit should match SessionStatistics.activeSessionLength.

          • count: number

            Number of sessions associated with this profile or identifier.

            Often used in combination with SessionStatistics.averageSessionLength.

          • id: string

            Unique identifier for this session statistics record.

          • isReturningVisitor: boolean

            Indicates whether the visitor has been seen before.

            true typically means the visitor has at least one prior session.

          • landingPage: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            }

            Landing page for the session.

            Represents the first page the user visited in this session.

            Page

            • path: string

              Path component of the page URL (e.g., /products/123).

            • query: Record<string, string>

              Parsed query parameters for the page.

            • referrer: string

              Referrer URL that led to the current page.

            • search: string

              Raw search string including the leading ? (e.g., "?q=test").

            • Optionaltitle?: string

              Title of the page as seen by the user.

            • url: string

              Full URL of the page.

        • stableId: string

          Stable, long-lived identifier of the profile.

          Intended to remain constant across sessions and devices when possible. Usually equal to id.

        • traits: Record<string, JSONType>

          Traits describing the profile (user-level attributes).

          Traits

      Returns string | undefined

      The resolved value (typically a string) or undefined if not found.

      const name = core.getMergeTagValue(mergeTagNode, profile)
      
    • Convenience wrapper for sending an identify event through the Experience path.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            screen?: { name: string; [key: string]: JSONType };
            traits?: Record<string, JSONType>;
            userAgent?: string;
            userId: string;
        } & { profile?: { id: string; [key: string]: JSONType } }

        Identify builder arguments.

      Returns Promise<OptimizationData | undefined>

      The resulting OptimizationData for the identified user.

      const data = await core.identify({ userId: 'user-123', traits: { plan: 'pro' } })
      
    • Convenience wrapper for sending a page event through the Experience path.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            properties?: {
                path?: string;
                query?: Record<string, string>;
                referrer?: string;
                search?: string;
                title?: string;
                url?: string;
                [key: string]: JSONType;
            };
            screen?: { name: string; [key: string]: JSONType };
            userAgent?: string;
        } & { profile?: { id: string; [key: string]: JSONType } } = {}

        Page view builder arguments.

      Returns Promise<OptimizationData | undefined>

      The evaluated OptimizationData for this page view.

      const data = await core.page({ properties: { title: 'Home' } })
      
    • Resolve a Contentful entry to the appropriate optimized variant (or return the baseline entry if no matching variant is selected).

      Type Parameters

      • S extends EntrySkeletonType = EntrySkeletonType

        Entry skeleton type.

      • L extends string = string

        Locale code.

      Parameters

      • entry: Entry<S, undefined, L>

        The baseline entry to resolve.

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

        Optional selected optimization array for the current profile.

        • experienceId: string

          Identifier of the personalization or experiment experience.

        • Optionalsticky?: boolean

          Indicates whether this optimization selection is sticky for the user.

          false
          

          Sticky selections should be reused 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.

      Returns ResolvedData<S, undefined, L>

      ResolvedData containing the resolved entry and selected optimization metadata (if any).

      const { entry, selectedOptimization } = core.resolveOptimizedEntry(
      baselineEntry,
      data.selectedOptimizations,
      )
    • Resolve a Contentful entry to the appropriate optimized variant (or return the baseline entry if no matching variant is selected).

      Type Parameters

      • S extends EntrySkeletonType

        Entry skeleton type.

      • M extends ChainModifiers = ChainModifiers

        Chain modifiers.

      • L extends string = string

        Locale code.

      Parameters

      • entry: Entry<S, M, L>

        The baseline entry to resolve.

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

        Optional selected optimization array for the current profile.

        • experienceId: string

          Identifier of the personalization or experiment experience.

        • Optionalsticky?: boolean

          Indicates whether this optimization selection is sticky for the user.

          false
          

          Sticky selections should be reused 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.

      Returns ResolvedData<S, M, L>

      ResolvedData containing the resolved entry and selected optimization metadata (if any).

      const { entry, selectedOptimization } = core.resolveOptimizedEntry(
      baselineEntry,
      data.selectedOptimizations,
      )
    • Convenience wrapper for sending a screen event through the Experience path.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            name: string;
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            properties: Record<string, JSONType>;
            screen?: { name: string; [key: string]: JSONType };
            userAgent?: string;
        } & { profile?: { id: string; [key: string]: JSONType } }

        Screen view builder arguments.

      Returns Promise<OptimizationData | undefined>

      The evaluated OptimizationData for this screen view.

      const data = await core.screen({ name: 'HomeScreen' })
      
    • Parameters

      • _method: string
      • _args: readonly unknown[]
      • event:
            | {
                channel: "mobile"
                | "server"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "alias";
                userId?: string;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "group";
                userId?: string;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                traits: Record<string, JSONType>;
                type: "identify";
                userId?: string;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    userAgent?: string;
                };
                messageId: string;
                name?: string;
                originalTimestamp: string;
                properties: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                sentAt: string;
                timestamp: string;
                type: "page";
                userId?: string;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    screen: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                messageId: string;
                name: string;
                originalTimestamp: string;
                properties?: Record<string, JSONType>;
                sentAt: string;
                timestamp: string;
                type: "screen";
                userId?: string;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                event: string;
                messageId: string;
                originalTimestamp: string;
                properties: Record<string, JSONType>;
                sentAt: string;
                timestamp: string;
                type: "track";
                userId?: string;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                componentId: string;
                componentType: "Entry" | "Variable";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                experienceId?: string;
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "component";
                userId?: string;
                variantIndex: number;
                viewDurationMs?: number;
                viewId?: string;
            }
        • {
              channel: "mobile" | "server" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "alias";
              userId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "alias"

            Discriminator indicating that this event is an alias event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

        • {
              channel: "mobile" | "server" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "group";
              userId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "group"

            Discriminator indicating that this event is a group event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

        • {
              channel: "mobile" | "server" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              traits: Record<string, JSONType>;
              type: "identify";
              userId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • traits: Record<string, JSONType>

            Traits describing the user.

            Traits

          • type: "identify"

            Discriminator indicating that this event is an identify event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

        • {
              channel: "mobile" | "server" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  userAgent?: string;
              };
              messageId: string;
              name?: string;
              originalTimestamp: string;
              properties: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              };
              sentAt: string;
              timestamp: string;
              type: "page";
              userId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                userAgent?: string;
            }

            Override the context property of UniversalEventProperties with a page-specific context.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • page: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }

              Page context for events that occur within a web page.

              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • Optionalname?: string

            Optional name for the page.

            Useful when the logical page name differs from the URL or title.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • properties: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            }

            Page-level properties such as URL, path, and referrer.

            • path: string

              Path component of the page URL (e.g., /products/123).

            • query: Record<string, string>

              Parsed query parameters for the page.

            • referrer: string

              Referrer URL that led to the current page.

            • search: string

              Raw search string including the leading ? (e.g., "?q=test").

            • Optionaltitle?: string

              Title of the page as seen by the user.

            • url: string

              Full URL of the page.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "page"

            Discriminator indicating that this event is a page view.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

        • {
              channel: "mobile" | "server" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  screen: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              messageId: string;
              name: string;
              originalTimestamp: string;
              properties?: Record<string, JSONType>;
              sentAt: string;
              timestamp: string;
              type: "screen";
              userId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                screen: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Override the context property of UniversalEventProperties with a screen-specific context.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • screen: { name: string; [key: string]: JSONType }

              Screen context for events that occur within a mobile or TV application.

              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • name: string

            Name of the screen being viewed.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • Optionalproperties?: Record<string, JSONType>

            Optional properties describing the screen context.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "screen"

            Discriminator indicating that this event is a screen view.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

        • {
              channel: "mobile" | "server" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              event: string;
              messageId: string;
              originalTimestamp: string;
              properties: Record<string, JSONType>;
              sentAt: string;
              timestamp: string;
              type: "track";
              userId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • event: string

            Name of the event being tracked.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • properties: Record<string, JSONType>

            Additional properties describing the event.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "track"

            Discriminator indicating that this event is a track event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

        • {
              channel: "mobile" | "server" | "web";
              componentId: string;
              componentType: "Entry" | "Variable";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              experienceId?: string;
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "component";
              userId?: string;
              variantIndex: number;
              viewDurationMs?: number;
              viewId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • componentId: string

            Contentful entry ID or flag key corresponding to the interaction.

          • componentType: "Entry" | "Variable"

            Type of tracked optimization target for the interaction event.

            • 'Entry' — A content entry.
            • 'Variable' — A Custom Flag or other variable-backed optimization target.
          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • OptionalexperienceId?: string

            Identifier of the experience that rendered this entry or flag.

            Optional; interactions may occur outside of a specific experiment/personalization.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "component"

            Discriminator indicating that this is an entry or flag view event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • variantIndex: number

            Index of the variant associated with this interaction.

            Typically corresponds to the index of the selected optimization entry.

          • OptionalviewDurationMs?: number

            Monotonically increasing visible duration for the active view.

            This value is updated and re-emitted while the same view remains active.

          • OptionalviewId?: string

            UUID identifying a single active view session.

            Multiple events emitted for the same active view share this identifier.

      • Optionalprofile: { id: string; [key: string]: JSONType }
        • [key: string]: JSONType
        • id: string

          Identifier of the profile.

          Used to associate events with an existing profile.

      Returns Promise<OptimizationData>

    • Parameters

      • _method: string
      • _args: readonly unknown[]
      • event:
            | {
                channel: "mobile"
                | "server"
                | "web";
                componentId: string;
                componentType: "Entry" | "Variable";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                experienceId?: string;
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "component";
                userId?: string;
                variantIndex: number;
                viewDurationMs?: number;
                viewId?: string;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                componentId: string;
                componentType: "Entry" | "Variable";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                experienceId?: string;
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "component_click";
                userId?: string;
                variantIndex: number;
            }
            | {
                channel: "mobile"
                | "server"
                | "web";
                componentId: string;
                componentType: "Entry" | "Variable";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                experienceId?: string;
                hoverDurationMs: number;
                hoverId: string;
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "component_hover";
                userId?: string;
                variantIndex: number;
            }
        • {
              channel: "mobile" | "server" | "web";
              componentId: string;
              componentType: "Entry" | "Variable";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              experienceId?: string;
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "component";
              userId?: string;
              variantIndex: number;
              viewDurationMs?: number;
              viewId?: string;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • componentId: string

            Contentful entry ID or flag key corresponding to the interaction.

          • componentType: "Entry" | "Variable"

            Type of tracked optimization target for the interaction event.

            • 'Entry' — A content entry.
            • 'Variable' — A Custom Flag or other variable-backed optimization target.
          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • OptionalexperienceId?: string

            Identifier of the experience that rendered this entry or flag.

            Optional; interactions may occur outside of a specific experiment/personalization.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "component"

            Discriminator indicating that this is an entry or flag view event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • variantIndex: number

            Index of the variant associated with this interaction.

            Typically corresponds to the index of the selected optimization entry.

          • OptionalviewDurationMs?: number

            Monotonically increasing visible duration for the active view.

            This value is updated and re-emitted while the same view remains active.

          • OptionalviewId?: string

            UUID identifying a single active view session.

            Multiple events emitted for the same active view share this identifier.

        • {
              channel: "mobile" | "server" | "web";
              componentId: string;
              componentType: "Entry" | "Variable";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              experienceId?: string;
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "component_click";
              userId?: string;
              variantIndex: number;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • componentId: string

            Contentful entry ID or flag key corresponding to the interaction.

          • componentType: "Entry" | "Variable"

            Type of tracked optimization target for the interaction event.

            • 'Entry' — A content entry.
            • 'Variable' — A Custom Flag or other variable-backed optimization target.
          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • OptionalexperienceId?: string

            Identifier of the experience that rendered this entry or flag.

            Optional; interactions may occur outside of a specific experiment/personalization.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "component_click"

            Discriminator indicating that this is an entry click event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • variantIndex: number

            Index of the variant associated with this interaction.

            Typically corresponds to the index of the selected optimization entry.

        • {
              channel: "mobile" | "server" | "web";
              componentId: string;
              componentType: "Entry" | "Variable";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              experienceId?: string;
              hoverDurationMs: number;
              hoverId: string;
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "component_hover";
              userId?: string;
              variantIndex: number;
          }
          • channel: "mobile" | "server" | "web"

            Channel from which the event originated.

          • componentId: string

            Contentful entry ID or flag key corresponding to the interaction.

          • componentType: "Entry" | "Variable"

            Type of tracked optimization target for the interaction event.

            • 'Entry' — A content entry.
            • 'Variable' — A Custom Flag or other variable-backed optimization target.
          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • gdpr: { isConsentGiven: boolean }

              GDPR-related consent information.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • locale: string

              Locale identifier of the event (e.g., "en-US").

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string>

                Parsed query parameters for the page.

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • OptionalexperienceId?: string

            Identifier of the experience that rendered this entry or flag.

            Optional; interactions may occur outside of a specific experiment/personalization.

          • hoverDurationMs: number

            Monotonically increasing hover duration for the active hover.

            This value is updated and re-emitted while the same hover remains active.

          • hoverId: string

            UUID identifying a single active hover session.

            Multiple events emitted for the same active hover share this identifier.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            ISO 8601 datetime string.

          • sentAt: string

            Timestamp when the event payload was sent.

            ISO 8601 datetime string.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            ISO 8601 datetime string.

          • type: "component_hover"

            Discriminator indicating that this is an entry hover event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • variantIndex: number

            Index of the variant associated with this interaction.

            Typically corresponds to the index of the selected optimization entry.

      • Optionalprofile: { id: string; [key: string]: JSONType }
        • [key: string]: JSONType
        • id: string

          Identifier of the profile.

          Used to associate events with an existing profile.

      Returns Promise<void>

    • Convenience wrapper for sending a custom track event through the Experience path.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            event: string;
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            properties?: Record<string, JSONType>;
            screen?: { name: string; [key: string]: JSONType };
            userAgent?: string;
        } & { profile?: { id: string; [key: string]: JSONType } }

        Track builder arguments.

      Returns Promise<OptimizationData | undefined>

      The evaluated OptimizationData for this event.

      const data = await core.track({ event: 'button_click', properties: { label: 'Buy' } })
      
    • Track an entry click through Insights.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            componentId: string;
            experienceId?: string;
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            screen?: { name: string; [key: string]: JSONType };
            userAgent?: string;
            variantIndex?: number;
        }

        Entry click builder arguments.

      Returns Promise<void>

      A promise that resolves when processing completes.

      await core.trackClick({ componentId: 'entry-123' })
      
    • Track a feature flag view through Insights.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            componentId: string;
            experienceId?: string;
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            screen?: { name: string; [key: string]: JSONType };
            userAgent?: string;
            variantIndex?: number;
            viewDurationMs?: number;
            viewId?: string;
        }

        Flag view builder arguments used to build the flag view event.

      Returns Promise<void>

      A promise that resolves when processing completes.

      await core.trackFlagView({ componentId: 'feature-flag-123' })
      
    • Track an entry hover through Insights.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            componentId: string;
            experienceId?: string;
            hoverDurationMs: number;
            hoverId: string;
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            screen?: { name: string; [key: string]: JSONType };
            userAgent?: string;
            variantIndex?: number;
        }

        Entry hover builder arguments.

      Returns Promise<void>

      A promise that resolves when processing completes.

      await core.trackHover({ componentId: 'entry-123' })
      
    • Track an entry view through Insights and, when sticky, Experience.

      Parameters

      • payload: {
            campaign?: {
                content?: string;
                medium?: string;
                name?: string;
                source?: string;
                term?: string;
            };
            componentId: string;
            experienceId?: string;
            locale?: string;
            location?: {
                city?: string;
                continent?: string;
                coordinates?: { latitude: number; longitude: number };
                country?: string;
                countryCode?: string;
                postalCode?: string;
                region?: string;
                regionCode?: string;
                timezone?: string;
            };
            page?: {
                path: string;
                query: Record<string, string>;
                referrer: string;
                search: string;
                title?: string;
                url: string;
                [key: string]: JSONType;
            };
            screen?: { name: string; [key: string]: JSONType };
            sticky?: boolean;
            userAgent?: string;
            variantIndex?: number;
            viewDurationMs: number;
            viewId: string;
        } & { profile?: { id: string; [key: string]: JSONType } }

        Entry view builder arguments. When payload.sticky is true, the event will also be sent through Experience as a sticky entry view.

      Returns Promise<OptimizationData | undefined>

      A promise that resolves when all delegated calls complete.

      Experience receives sticky entry views only; Insights is always invoked regardless of sticky.

      await core.trackView({ componentId: 'entry-123', sticky: true })