Quickstart

4min

These instructions work with any javascript environment or framework that supports installing packages through NPM.

Installation

First install required packages to your project with npm or yarn.

Shell


Initialization

Before making any request it is required to provide the Klevu API key and the search server you are targeting. This should be done in the index of the application or the initialization of your app.

URL and apikey can be found from your KMC installation.

TypeScript
JS


Making a search

All queries to Klevu are made with KlevuFetch function. Inside KlevuFetch you provide any amount of query functions as parameters. In this example we do most basic product search with search term "hoodies".

TypeScript
JS


Simple Playground

Click here to see a simple example you can play with.



Updated 05 Jun 2024
Did this page help you?