As you can see in the example above, the init function receives a configuration object. This object contains all the dynamic parameters needed by X in runtime.
If you need to change this configuration once X is already initialized, check the Changing the dynamic configuration section.
This is the list of parameters that are currently supported:
||Unique identifier of your Search API instance.|
||This parameter is used to let X know whether the user has accepted the usage of cookies and therefore the user, session and user type cookies can be used and sent to the Search API.If this parameter is configured with false value, then the cookies will be deleted and removed from all Search API calls.No consent means results will not be personalized and signals (Related Tags, Next Queries, etc.) will not be inferred from that session.This parameter should be set to true as soon as the user accepts the usage of EmpathyBroker’s cookies.If accepting the cookies does not trigger a page reload, please consider using the EmpathyX.setConfig function (see the section below) to update the consent parameter so that the current session is tracked already.|
||The value of this parameter is sent to the Tagging API to be able to segment user sessions by device in analytics and reporting.The typical values for this field are ‘desktop’, ‘tablet’ and ‘mobile’, but any value is accepted, so pick the ones that best fit your necessities.Examples:
||This value tells EmpathyX if it should handle the layout in a right to left way or left to right way.|
|env||string||No||This parameter can be used to switch the Search and Tagging API environment.Production endpoints are used by default when this parameter is omitted.To use the STAGING environment, the value for this configuration would be ‘staging’.Examples:
||Language to be used by X for internationalizing messages (i.e. language of the search interface).If there are no translations for the specified language, the fallback language (‘en’) will be used.Examples:
|searchLang||string||No||‘en’||Language to be used by X for Search API requests (i.e. language of all catalog related information, such as results or filters).By default, if searchLang is omitted, all catalog related information is presented in the language specified in lang.Please note this parameter should only be used when messages and catalog are in different languages.Examples:
||Currency code (ISO 4217) to be used by X for price formatting, both for products and the price filter.Examples:
||This parameter allows pre-selecting filters even before the user launches the first search.Pre-selected filters are particularly useful for keeping consistency between navigation and search in those situations where the user is asked to pick an option before starting the journey, such as MAN / WOMAN in fashion or PERSONAL / BUSINESS in services and telecommunications. If this is not required, the usage of pre-selected filters is discouraged.Please note pre-selected filters behave as radio buttons in the sense that the user can change their values but not de-select them, so use them wisely.The configured filters must match the names and values in the catalog, which means that values have to be adapted to the selected language (e.g. ‘Woman’ for English vs ‘Mujer’ for Spanish).Examples:
|section||string||No||Section identifier used by X for the Discovery Wall featureNot applicable to all instances|
|store||string||No||Store identifier used by X when querying the Search API.Not applicable to all instances.|
|catalog||string||No||Catalog identifier used by X when querying the Search API.Not applicable to all instances.|
|warehouse||string||No||Warehouse identifier used by X when querying the Search API.Not applicable to all instances.|