Prerequisites — before implementing AI Search, complete the Installation step on the JS Library page. The library must be loaded site-wide.
Kleep AI Search integrates a search component into your storefront, powered by Kleep’s AI algorithms. Product Feeds must be created and deployed before you start this integration — please confirm this with your Kleep representative before implementing.
What AI Search delivers

A welcome page with first insights on your catalogue — most-searched queries and trends

Auto-suggestions appear as the shopper types. The complete list of suggestions is managed in the Kleep Search AI Dashboard — you can add, update, or remove them there.

A product-list page with add-to-cart and wishlist actions
Add a size to the cart if it’s in stock. When the shopper taps Add to cart on a size, your
addToCart callback runs with the variant reference.- Input — an object
{ variant_ref }: the reference of the variant (size) to add to the cart - Action — add the reference to the cart like a regular add-to-cart
- Output — none required
Add / remove a product from the wishlist. When the shopper taps the heart icon, your
toggleWishlist callback runs with the product reference.- Input — an object
{ product_ref }: the reference of the product being toggled - Action — if the reference is in the wishlist, remove it; if not, add it
- Output — the updated wishlist, as an array of
{ product_ref }objects
Method: kleep.search
Step 1: Create the container
Add the div where the search component should be attached:
kleep.search.init with your account credentials:
init loads the search bundle and its stylesheet for you and returns a promise: always await it before calling renderBox or renderResult. It resolves to true on success and false if the credentials are invalid or the bundle failed to load.
anonKey and retailerId are provided by your Kleep representative during onboarding. companyId is still accepted in place of retailerId but is deprecated.
Step 3: Render the search box
Call
kleep.search.renderBox with the container ID (without the #) and your callback implementations:
/search?q=... — the URL is yours to choose, via onViewAll or onSearchSubmit) and render the results there:
renderResult with an empty query while results are already displayed keeps them as they are.
Parameters & Callbacks
renderResult accepts query, gender, lang, getWishlistItems, toggleWishlist and addToCart with the same meaning.
Full example with callbacks
Take over the bag icon
Product cards also show a bag icon. By default it opens Kleep’s size picker; if your storefront has its own quick-add drawer, pass anaddToCart callback to init and Kleep hands you the product instead:
init. It is not called for sold-out products.
Search with a photo
When enabled for your account by Kleep, a camera button appears in the search bar: the shopper uploads a photo and gets visually similar products. Photo search needs your results page to be wired up (onViewAll or onSearchSubmit set). For a photo search, onViewAll receives an empty query and options.visualQueryId; add kleep_visual=<visualQueryId> to the results URL you open, and renderResult with an empty query shows the photo results.
Appearance and behaviour
Theme, layout, suggestions, filters, landing pages and custom CSS are managed by Kleep per retailer, and take effect without changes to your code. Ask your Kleep representative to adjust them. For example, the results page can be rendered as the search box itself (a “search box” layout) instead of the classic results grid.Additional Prestashop permissions for Search
Additional Prestashop permissions for Search
If you’re using AI Search on a Prestashop store, your Kleep webservice key needs a few extra
GET permissions on top of the ones listed in the Prestashop integration guide:
