atomic-recs-interface
atomic-recs-interface
This is for:
DeveloperThe atomic-recs-interface
component is the parent to all other atomic components in a recommendation interface. It handles the headless recommendation engine and localization configurations.
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
|
|
The value to set the nonce attribute to on inline script and style elements generated by this interface and its child components.
If your application is served with a Content Security Policy (CSP) that doesn’t include the Example:
|
|
|
|
|
Whether analytics should be enabled. |
|
|
|
The recommendation interface headless engine. |
|
||
|
|
A list of non-default fields to include in the query results. Specify the property as an array using a JSON string representation:
|
|
|
|
The recommendation interface i18next instance. |
|
|
|
|
|
The icon assets path. By default, this will be a relative URL pointing to Example: "/mypublicpath/icons" |
|
|
|
|
The recommendation interface language. |
|
|
|
|
The language assets path. By default, this will be a relative URL pointing to Example: "/mypublicpath/languages" |
|
|
|
|
The severity level of the messages to log in the console. |
|
|
|
|
The recommendation interface query pipeline. If the recommendation interface is initialized using |
|
|
|
|
The recommendation interface search hub. If the recommendation interface is initialized using |
|
|
|
|
The tz database identifier of the time zone to use to correctly interpret dates in the query expression, facets, and result items. By default, the timezone will be guessed. Example: "America/Montreal" |
|
Methods
getRecommendations
Fetches new recommendations.
Signature: getRecommendations() => Promise<void>
Returns: Promise<void>
initialize
Initializes the connection with the headless recommendation engine using options for accessToken
(required), organizationId
(required), environment
(defaults to prod
), and renewAccessToken
.
Signature: initialize(options: RecsInitializationOptions) => Promise<void>
Returns: Promise<void>
initializeWithRecommendationEngine
Initializes the connection with an already preconfigured headless recommendation engine. This bypasses the properties set on the component, such as analytics, recommendation, searchHub, language, timezone & logLevel.
Signature: initializeWithRecommendationEngine(engine: RecommendationEngine) => Promise<void>
Returns: Promise<void>