Creates a new product base instance.
Options for configuring the functionality common among products.
Protected Optional ReadonlyallowedAllow‑list of event type keys permitted when consent is not present.
Protected ReadonlyapiOptimization API client used to send events to the Experience and Insights APIs.
Protected ReadonlybuilderEvent builder used to construct strongly‑typed events.
ReadonlyduplicationDeduplication helper used to track previously seen values within optional scopes
ReadonlyflagsStatic resolver for evaluating personalized custom flags.
Build a flattened map of flag keys to values from a change list.
Optionalchanges: {The change list returned by the optimization service.
Key identifying the subject of the change.
Metadata describing the originating experience and variant index.
Identifier of the personalization or experiment experience.
Index of the variant within the experience configuration.
Discriminator for a variable change.
New value for the variable identified by ChangeBase.key.
A map of flag keys to their resolved values.
ReadonlyinterceptorsInterceptors that can mutate/augment outgoing events or optimization state.
ReadonlymergeStatic resolver that returns values sourced from a user profile based on a Contentful Merge Tag entry.
Look up a merge-tag value from a profile using normalized selectors.
Merge-tag identifier.
Optionalprofile: {Profile from which to resolve the value.
List of audience identifiers that this profile currently belongs to.
Primary identifier of the profile.
Geo-location information associated with the profile.
Optionalcity?: stringCity name associated with the location.
Optionalcontinent?: stringContinent name associated with the location.
Optionalcoordinates?: { latitude: number; longitude: number }Geographical coordinates for the location.
Latitude component of the coordinates.
Longitude component of the coordinates.
Optionalcountry?: stringCountry name associated with the location.
OptionalcountryCode?: stringCountry code associated with the location.
OptionalpostalCode?: stringPostal or ZIP code associated with the location.
Optionalregion?: stringRegion or state name associated with the location.
OptionalregionCode?: stringRegion or state code associated with the location.
Optionaltimezone?: stringTime zone identifier associated with the location.
Random value associated with the profile.
Aggregated session statistics for the profile.
Duration of the active session.
Average session duration across all sessions represented by this record.
The unit should match SessionStatistics.activeSessionLength.
Number of sessions associated with this profile or identifier.
Often used in combination with SessionStatistics.averageSessionLength.
Unique identifier for this session statistics record.
Indicates whether the visitor has been seen before.
Landing page for the session.
Path component of the page URL (e.g., /products/123).
Parsed query parameters for the page.
Referrer URL that led to the current page.
Raw search string including the leading ? (e.g., "?q=test").
Optionaltitle?: stringTitle of the page as seen by the user.
Full URL of the page.
Stable, long-lived identifier of the profile.
Traits describing the profile (user-level attributes).
A stringified primitive if found; otherwise undefined.
Type guard to ensure the input is a MergeTagEntry.
Unknown value to validate.
true if the input is a valid merge-tag entry.
Generate a list of candidate selectors for a merge-tag ID.
Merge-tag identifier (segments separated by _).
Array of dot-path selectors to try against a profile.
Resolve the display value for a merge-tag entry using the provided profile,
falling back to the entry's configured nt_fallback when necessary.
The merge-tag entry to resolve.
Optionalnt_fallback?: stringFallback value to use when the merge tag cannot be resolved.
Internal identifier of the merge tag.
Human-readable name of the merge tag.
Contentful metadata, including tags.
System fields extended to constrain the content type to nt_mergetag.
Optionalprofile: {Optional profile used for lookup.
List of audience identifiers that this profile currently belongs to.
Primary identifier of the profile.
Geo-location information associated with the profile.
Optionalcity?: stringCity name associated with the location.
Optionalcontinent?: stringContinent name associated with the location.
Optionalcoordinates?: { latitude: number; longitude: number }Geographical coordinates for the location.
Latitude component of the coordinates.
Longitude component of the coordinates.
Optionalcountry?: stringCountry name associated with the location.
OptionalcountryCode?: stringCountry code associated with the location.
OptionalpostalCode?: stringPostal or ZIP code associated with the location.
Optionalregion?: stringRegion or state name associated with the location.
OptionalregionCode?: stringRegion or state code associated with the location.
Optionaltimezone?: stringTime zone identifier associated with the location.
Random value associated with the profile.
Aggregated session statistics for the profile.
Duration of the active session.
Average session duration across all sessions represented by this record.
The unit should match SessionStatistics.activeSessionLength.
Number of sessions associated with this profile or identifier.
Often used in combination with SessionStatistics.averageSessionLength.
Unique identifier for this session statistics record.
Indicates whether the visitor has been seen before.
Landing page for the session.
Path component of the page URL (e.g., /products/123).
Parsed query parameters for the page.
Referrer URL that led to the current page.
Raw search string including the leading ? (e.g., "?q=test").
Optionaltitle?: stringTitle of the page as seen by the user.
Full URL of the page.
Stable, long-lived identifier of the profile.
Traits describing the profile (user-level attributes).
The resolved string, or undefined if the entry is invalid and no
fallback is available.
ReadonlypersonalizedStatic resolver for personalized Contentful entries (e.g., entry variants targeted to a profile audience).
Find the personalization entry corresponding to one of the selected experiences.
Object containing the baseline personalized entry and the selections.
When true, skip type/shape validation for perf.
The matching PersonalizationEntry, or undefined if not found/invalid.
Optionalnt_audience?: The audience of the personalization (Audience).
The configuration of a PersonalizationEntry (JSON).
Accepts null or an explicit PersonalizationConfig and converts
falsy/undefined values into a default configuration.
Optionalnt_description?: null | stringThe description of the personalization (Short Text).
The personalization/experience ID related to this personalization entry.
The name of the personalization (Short Text).
The type of the personalization (nt_experiment | nt_personalization).
Optionalnt_variants?: Entry[]All used variants of the personalization (Contentful references to other Content Types).
Contentful metadata, including tags.
System-managed properties describing the entry.
Look up the selection metadata for a specific personalization entry.
Object with the target personalization entry and selections.
When true, skip type checks.
The matching SelectedPersonalization, if present.
Identifier of the personalization or experiment experience.
Optionalsticky?: booleanIndicates whether this personalization selection is sticky for the user.
Index of the selected variant within the experience configuration.
Typically corresponds to the index of the selected PersonalizationConfig entry.
Mapping of baseline entry IDs to their selected variant entry IDs.
Get the replacement variant config for the given selection index.
Baseline entry, personalization entry, and 1‑based variant index.
When true, skip type checks.
The EntryReplacementVariant for the component, if any.
Indicates whether this variant is hidden from allocation/traffic.
Unique identifier for the variant.
Resolve the concrete Contentful entry that corresponds to a selected variant.
Entry skeleton type.
Chain modifiers.
Locale code.
Personalization entry and selected variant.
When true, skip type checks.
The resolved entry typed as Entry or undefined.
Resolve the selected entry (baseline or variant) for a personalized entry and optional selected personalizations, returning both the entry and the personalization metadata.
Entry skeleton type.
Chain modifiers.
Locale code.
The baseline personalized entry.
OptionalselectedPersonalizations: {Optional selections for the current profile.
Identifier of the personalization or experiment experience.
Optionalsticky?: booleanIndicates whether this personalization selection is sticky for the user.
Index of the selected variant within the experience configuration.
Typically corresponds to the index of the selected PersonalizationConfig entry.
Mapping of baseline entry IDs to their selected variant entry IDs.
An object containing the resolved entry and (if chosen) the selection.
Get the specified Custom Flag's value from the supplied changes.
The name/key of the Custom Flag.
Optionalchanges: {Optional changes array.
Key identifying the subject of the change.
Metadata describing the originating experience and variant index.
Identifier of the personalization or experiment experience.
Index of the variant within the experience configuration.
Discriminator for a variable change.
New value for the variable identified by ChangeBase.key.
The current value of the Custom Flag if found.
Resolve a merge tag to a value based on the current (or provided) profile.
The merge tag entry node to resolve.
Optionalnt_fallback?: stringFallback value to use when the merge tag cannot be resolved.
Internal identifier of the merge tag.
Human-readable name of the merge tag.
Contentful metadata, including tags.
System fields extended to constrain the content type to nt_mergetag.
Optionalprofile: {Optional profile.
List of audience identifiers that this profile currently belongs to.
Primary identifier of the profile.
Geo-location information associated with the profile.
Optionalcity?: stringCity name associated with the location.
Optionalcontinent?: stringContinent name associated with the location.
Optionalcoordinates?: { latitude: number; longitude: number }Geographical coordinates for the location.
Latitude component of the coordinates.
Longitude component of the coordinates.
Optionalcountry?: stringCountry name associated with the location.
OptionalcountryCode?: stringCountry code associated with the location.
OptionalpostalCode?: stringPostal or ZIP code associated with the location.
Optionalregion?: stringRegion or state name associated with the location.
OptionalregionCode?: stringRegion or state code associated with the location.
Optionaltimezone?: stringTime zone identifier associated with the location.
Random value associated with the profile.
Aggregated session statistics for the profile.
Duration of the active session.
Average session duration across all sessions represented by this record.
The unit should match SessionStatistics.activeSessionLength.
Number of sessions associated with this profile or identifier.
Often used in combination with SessionStatistics.averageSessionLength.
Unique identifier for this session statistics record.
Indicates whether the visitor has been seen before.
Landing page for the session.
Path component of the page URL (e.g., /products/123).
Parsed query parameters for the page.
Referrer URL that led to the current page.
Raw search string including the leading ? (e.g., "?q=test").
Optionaltitle?: stringTitle of the page as seen by the user.
Full URL of the page.
Stable, long-lived identifier of the profile.
Traits describing the profile (user-level attributes).
The resolved value (type depends on the tag).
Identify the current profile/visitor to associate traits with a profile.
Identify builder arguments with an optional partial profile to attach to the upsert request.
The resulting OptimizationData for the identified user.
Record a page view.
Page view builder arguments with an optional partial profile.
The evaluated OptimizationData for this page view.
Resolve a Contentful entry to a personalized variant using the current or provided selected personalizations.
Entry skeleton type.
Chain modifiers.
Locale code.
The entry to personalize.
Optionalpersonalizations: {Optional selected personalizations.
Identifier of the personalization or experiment experience.
Optionalsticky?: booleanIndicates whether this personalization selection is sticky for the user.
Index of the selected variant within the experience configuration.
Typically corresponds to the index of the selected PersonalizationConfig entry.
Mapping of baseline entry IDs to their selected variant entry IDs.
The resolved entry data.
Record a screen view.
Screen view builder arguments with an optional partial profile.
The evaluated OptimizationData for this screen view.
Record a custom track event.
Track builder arguments with an optional partial profile.
The evaluated OptimizationData for this event.
Record a "sticky" component view.
Component view builder arguments with an optional partial profile.
The evaluated OptimizationData for this component view.
Stateless personalization implementation that immediately validates and sends a single event to the Experience API, upserting the profile as needed.
Remarks
Each public method constructs a strongly-typed event via the shared builder, runs it through event interceptors, and performs a profile upsert using the Experience API. If an anonymous ID is available from the builder, it will be preferred as the
profileIdunless an explicit profile is provided.