Contentful Personalization & Analytics
    Preparing search index...

    Options that control how requests to the Experience API are handled.

    interface ExperienceApiClientRequestOptions {
        enabledFeatures?: Feature[];
        ip?: 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;
        };
        plainText?: boolean;
        preflight?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    enabledFeatures?: Feature[]

    Enabled features (for example, "ip-enrichment") for the API to use for this request.

    When omitted, the API can apply a default set of features.

    ip?: string

    IP address to override the API behavior for IP analysis.

    Commonly used in ESR or SSR environments, as the API otherwise uses the server IP.

    locale?: string

    Experience API locale query parameter used to translate profile location fields such as location.city and location.country.

    When omitted, the API can use a server-side default.

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

    Request location for createProfile(), updateProfile(), and upsertProfile().

    Type Declaration

    • 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").

    A per-request value replaces the constructor default as a whole object. The API merges each event's context.location over this request location. An explicit {} overrides the constructor default and supplies an empty request-location default instead of Cloudflare geolocation. When omitted from both sources, existing API fallback behavior applies. This affects evaluation and profile updates; it is not a permanent location lock. For upsertManyProfiles(), use each event's context.location instead.

    plainText?: boolean

    When true, sends performance-critical endpoints in plain text.

    The Ninetailed API accepts certain endpoints in plain text to avoid CORS preflight requests, which can improve performance in browser environments.

    preflight?: boolean

    When true, instructs the API to aggregate a new profile state but not store it.

    This is commonly used in ESR or SSR environments where you want to preview the result without persisting changes.