Contentful Personalization & Analytics
    Preparing search index...

    Combined observable state exposed by the stateful core.

    interface CoreStates {
        blockedEventStream: Observable<BlockedEvent | undefined>;
        canOptimize: Observable<boolean>;
        consent: Observable<boolean | undefined>;
        eventStream: Observable<OptimizationEventStreamEvent | undefined>;
        experienceRequestState: Observable<ExperienceRequestState>;
        flag: (name: string) => Observable<unknown>;
        locale: Observable<string | undefined>;
        optimizationPossible: Observable<boolean>;
        persistenceConsent: Observable<boolean | undefined>;
        previewPanelAttached: Observable<boolean>;
        previewPanelOpen: Observable<boolean>;
        profile: Observable<
            | {
                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>;
            }
            | undefined,
        >;
        selectedOptimizations: Observable<
            | {
                experienceId: string;
                sticky?: boolean;
                variantIndex: number;
                variants: Record<string, string>;
            }[]
            | undefined,
        >;
    }
    Index

    Properties

    blockedEventStream: Observable<BlockedEvent | undefined>

    Stream of the most recent blocked event payload.

    canOptimize: Observable<boolean>

    Whether optimization data is available.

    consent: Observable<boolean | undefined>

    Current consent value (if any).

    eventStream: Observable<OptimizationEventStreamEvent | undefined>

    Stream of the most recent event emitted.

    experienceRequestState: Observable<ExperienceRequestState>

    Outcome of the most recent Experience API request.

    flag: (name: string) => Observable<unknown>

    Key-scoped observable for a single Custom Flag value.

    locale: Observable<string | undefined>

    Live view of the SDK Experience API/event locale.

    optimizationPossible: Observable<boolean>

    Whether the current consent + allow-list configuration could ever produce optimizations.

    persistenceConsent: Observable<boolean | undefined>

    Current durable profile-continuity persistence consent value (if any).

    previewPanelAttached: Observable<boolean>

    Whether the preview panel has been attached to the host runtime.

    previewPanelOpen: Observable<boolean>

    Whether the preview panel is open in the host runtime.

    profile: Observable<
        | {
            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>;
        }
        | undefined,
    >

    Live view of the current profile.

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

    Live view of selected optimizations (variants).