Contentful Personalization & Analytics
    Preparing search index...

    Configuration for the Node-specific ContentfulOptimization SDK.

    This configuration extends CoreStatelessConfig but allows partial overrides of the event-builder configuration. SDKs commonly inject their own library metadata or channel definitions.

    interface OptimizationNodeConfig {
        allowedEventTypes?: AllowedEventType[];
        api?: CoreStatelessApiConfig;
        app?: { name: string; version: string };
        clientId: string;
        environment?: string;
        eventBuilder?: Partial<
            Omit<
                Omit<
                    EventBuilderConfig,
                    "getLocale"
                    | "getPageProperties"
                    | "getUserAgent",
                >,
                "app" | "getConsent",
            >,
        >;
        fetchOptions?: Omit<ProtectedFetchMethodOptions, "apiName">;
        locale?: string;
        logLevel?: LogLevels;
        onEventBlocked?: (event: BlockedEvent) => void;
    }

    Hierarchy

    Index

    Properties

    allowedEventTypes?: AllowedEventType[]

    Allow-listed event type strings permitted when request event consent is not granted.

    Unified API configuration for stateless environments.

    app?: { name: string; version: string }

    The application definition used to attribute events to a specific consumer app.

    Type Declaration

    • name: string

      Name of the application.

    • version: string

      Version of the application.

    When not provided, events will not contain app metadata in their context.

    clientId: string

    Client identifier used for authentication or tracking.

    environment?: string

    Contentful environment identifier.

    'main'

    eventBuilder?: Partial<
        Omit<
            Omit<
                EventBuilderConfig,
                "getLocale"
                | "getPageProperties"
                | "getUserAgent",
            >,
            "app" | "getConsent",
        >,
    >

    Partial overrides for the event builder configuration.

    Any provided fields are merged with the default Node SDK metadata. Request-scoped consent should be bound with forRequest(), not configured on the SDK singleton.

    This differs from CoreStatelessConfig eventBuilder, which expects a full configuration object.

    fetchOptions?: Omit<ProtectedFetchMethodOptions, "apiName">

    Options used to configure the underlying protected fetch method.

    apiName is derived from the client name and must not be provided here.

    locale?: string

    Default SDK locale used for Experience API requests and event context.

    logLevel?: LogLevels

    Minimum log level for the default console sink.

    onEventBlocked?: (event: BlockedEvent) => void

    Callback invoked whenever an event call is blocked by consent.