website logo
Product FeedCommunity Forum
API Docs
Template JS
Headless SDK
Navigate through spaces
API Docs
Template JS
Headless SDK
⌘K
Introduction
Getting Started
Quickstart : Smart Search
Quickstart : Smart Category Merchandising
Quickstart : Smart Recommendations
Apps/Plug-ins
Guide
Structure
Configuration
JS Library
Versioning
Template Reference
Build UI
Custom Overrides
Recommendations Webhooks
Styling CSS
Analytics/Tracking
How To
Add Filters To URL
Add Pagination To URL
Add-To-Cart Function
Customer Groups
Infinite Scroll Results
Magento B2B MSI
Ratings / Reviews
SortBy Options
Docs powered by archbee 
17min

Versioning



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/klevu-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 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.



.

Updated 03 Mar 2023
Did this page help you?
Yes
No
UP NEXT
Template Reference
Docs powered by archbee 
TABLE OF CONTENTS
Klevu JS Library
Klevu Theme Versioning
Klevu Template Resource Files
Debug / Development Versions
Lazy-Load Versions