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 compatibility JSON version for i18next to use (see i18next Migration Guide). |
|
|
|
|
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
getOrganizationEndpoints
Signature: getOrganizationEndpoints(organizationId: string, env?: PlatformEnvironment) => Promise<{ platform: string; analytics: string; search: string; admin: string; }>
Returns: Promise<{ platform: string; analytics: string; search: string; admin: string; }>
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), renewAccessToken
, and platformUrl
.
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>