Library Reference
Configuration
6 min
specific configuration values used by klevu are kept as a snippet of code which looks something like the following var options = { url { search 'https //eucs3v2 ksearchnet com/cs/v2/search', landing '/search results', queryparam 'q' }, search { apikey 'klevu 123xxxxxxxxxxxxxx', searchboxselector 'input#klevu search', } analytics { apikey 'klevu 123xxxxxxxxxxxxxx' } }; klevu(options); settings settings available within options object 166,209,300,112 false true unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type useful local storage settings true false 187,96false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type code eample // this code waits for klevu js to load first window klvready= window klvready|| \[]; window klvready push(function(){ // we will set the items per page one time using a variable var itemsperpage = 24; // now we can use the variable to set both the product and content tab // items per page localstorage setitem('klv limits productlist', itemsperpage); localstorage setitem('klv limits contentlist', itemsperpage); }); useful session storage settings for key names that include \[apikey] you would replace this with your account's apikey value here's an example sessionstorage setitem(`klv view klevu 14728819608184175 productlist`, 'grid'); true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type code example // this code waits for klevu js to load first window klvready= window klvready|| \[]; window klvready push(function(){ // run this function when search and/or category pages load klevu beforeactivation('landing,catnav', function(data ,scope){ // set session storage value using a useful function to dynamically // retrieve your apikey sessionstorage setitem(`klv view ${klevu pagemeta getapikey()} productlist`, 'list'); }, 'build'); });