Library Reference

Versioning

16min
klevu js library the core klevu js library is provided on the following url \<script src="https //js klevu com/core/ v2 /klevu js">\</script> note the v2 path will always track the latest 2 x version and be the most up to date if you prefer to lock to a specific version, you can optionally indicate the specific version within the path e g https //js klevu com/core/2 3 9/klevu js if you opt to lock to a specific version, you will need to manually update your version from time to time to get the latest klevu features and bug fixes klevu theme versioning the klevu theme follows the same versioning process as the core klevu js library quick search \<script src="https //js klevu com/theme/default/v2/quick search js">\</script> search results landing page \<script src="https //js klevu com/theme/default/v2/search results page js">\</script> category/collection landing pages \<script src="https //js klevu com/theme/default/v2/category page js">\</script> recommendations widgets/banners \<script src="https //js klevu com/recs/v2/recs js">\</script> klevu template resource files the following tpl files are automatically pulled into the corresponding theme javascript during injection they are listed here to be used as a non minified reference note when viewing these in the browser, use view source to see the templates raw markup quick search https //js klevu com/theme/default/v2/quick templates tpl search results landing page https //js klevu com/theme/default/v2/landing templates tpl category/collection landing pages https //js klevu com/theme/default/v2/catnav templates tpl debug / development versions during your development you may find it easier to reference non minified versions of the script libraries you can access the non minified version of any core file by adding debug to the filename e g https //js klevu com/core/v2/klevu debug js https //js klevu com/theme/default/v2/quick search debug js https //js klevu com/theme/default/v2/quick styles debug css lazy load versions if you are using google pagespeed insights or lighthouse, you might find some klevu scripts labeld as render blocking klevu provides the option to lazy load our theme scripts which will improve your lighthouse performance score, but there is more to consider with lazy load enabled, the initial script sizes are tiny these scripts then request more resources when required, which can slightly slow the display of products compared to when lazy load is disabled, especially after the first page load when none of the lazy loaded scripts are cached we have included lazy load file options so you may try both settings and determine which works best for your site you can access the lazy load version of the following files by adding lazyload to the filename reference e g https //js klevu com/theme/default/v2/quick search lazyload js https //js klevu com/theme/default/v2/search results page lazyload js https //js klevu com/theme/default/v2/category page lazyload js it is not possible to have the https //js klevu com/core/v2/klevu js https //js klevu com/core/v2/klevu js to be lazyload it contains the main klevu js object which is used by other klevu scripts to render the results there is potential for conflicts with onpage objects expecting the klevu core to be in place magento users can find lazy load selection options within the magento klevu admin interface magento admin > stores > configuration > klevu > search configuration > developer settings see the knowledgebase guide for magento lazy loading for more details combined versions it is very common to load the quick search script along with the search result landing page script or the category/collection landing page script because the quick search is typically available on every page of your site because there is some shared code within the quick search script and the other two scripts, klevu also provides combined scripts that reduce the amount of javascript by 42% when using the combined scripts on either the search or category/collection pages so for example, instead of loading the quick search + search result landing page scripts separately on the search page, you could load the combined script instead and reduce the download size as well as reduce the execution time of the code within the combined script on that page the same is true on the category/collection landing pages there is no benefit when loading any other pages besides search or category/collection since the script for quick search has not changed https //js klevu com/theme/default/v2/quick landing search theme js https //js klevu com/theme/default/v2/quick catnav search theme js it is not possible to load these scripts with the automated integration available in the platform specific klevu apps, so using these scripts requires a manual integration of the template js library in your site you can follow the combined scripts docid\ dqcuu6v1yemu3nik0ayqg guide to see examples of how to integrate these combined scripts with shopify or bigcommerce