Contentful Personalization & Analytics
    Preparing search index...

    Request-bound stateless Optimization Core event client.

    Index

    Constructors

    Properties

    canPersistProfile: boolean

    Accessors

    • get profile(): { id: string; [key: string]: JSONType } | undefined

      Current request profile, updated after Experience responses.

      Returns { id: string; [key: string]: JSONType } | undefined

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

          Identifier of the profile.

          Used to associate events with an existing profile.

      • undefined

    Methods

    • Fetch a Contentful entry by ID or by content type and slug through the parent SDK's configured contentful.js client.

      Type Parameters

      Parameters

      Returns Promise<Entry<S, undefined, L>>

      Set entryQuery on an object descriptor to customize its query. If contentful.defaultQuery and the descriptor's entryQuery or per-call query omit locale, this request's locale becomes the managed Contentful query locale. Entry IDs use getEntry() or a coalesced getEntries() call; descriptors that identify entries by content type and slug use getEntries().

    • Fetch a Contentful entry by ID or by content type and slug through the parent SDK's configured contentful.js client.

      Type Parameters

      Parameters

      • descriptor:
            | {
                contentType?: undefined;
                entryId: string;
                entryQuery?: ContentfulEntryQuery;
                slug?: undefined;
                slugField?: undefined;
            }
            | {
                contentType: string;
                entryId?: undefined;
                entryQuery?: ContentfulEntryQuery;
                slug: string;
                slugField?: string;
            }

      Returns Promise<Entry<S, undefined, L>>

      Set entryQuery on an object descriptor to customize its query. If contentful.defaultQuery and the descriptor's entryQuery or per-call query omit locale, this request's locale becomes the managed Contentful query locale. Entry IDs use getEntry() or a coalesced getEntries() call; descriptors that identify entries by content type and slug use getEntries().

    • Fetch a Contentful entry by ID or by content type and slug, then resolve it with request-local selected optimizations.

      Type Parameters

      Parameters

      Returns Promise<FetchOptimizedEntryResult<S, undefined, L>>

      If options.selectedOptimizations is omitted, this uses the latest selected optimizations returned by an accepted request-bound Experience API call. Set entryQuery on an object descriptor to customize its query. If contentful.defaultQuery and the descriptor's entryQuery or per-call query omit locale, this request's locale becomes the managed Contentful query locale. Fetching follows the same getEntry() and getEntries() behavior as CoreStatelessRequest.fetchContentfulEntry.

    • Fetch a Contentful entry by ID or by content type and slug, then resolve it with request-local selected optimizations.

      Type Parameters

      Parameters

      • descriptor:
            | {
                contentType?: undefined;
                entryId: string;
                entryQuery?: ContentfulEntryQuery;
                slug?: undefined;
                slugField?: undefined;
            }
            | {
                contentType: string;
                entryId?: undefined;
                entryQuery?: ContentfulEntryQuery;
                slug: string;
                slugField?: string;
            }
      • Optionaloptions: Omit<FetchOptimizedEntryOptions, "query">

      Returns Promise<FetchOptimizedEntryResult<S, undefined, L>>

      If options.selectedOptimizations is omitted, this uses the latest selected optimizations returned by an accepted request-bound Experience API call. Set entryQuery on an object descriptor to customize its query. If contentful.defaultQuery and the descriptor's entryQuery or per-call query omit locale, this request's locale becomes the managed Contentful query locale. Fetching follows the same getEntry() and getEntries() behavior as CoreStatelessRequest.fetchContentfulEntry.

    • 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;
        }

      Returns Promise<EventEmissionResult>

    • 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;
        } = {}

      Returns Promise<EventEmissionResult>

    • 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;
        }

      Returns Promise<EventEmissionResult>

    • 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;
        }

      Returns Promise<EventEmissionResult>

    • 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;
        }

      Returns Promise<void>