Quickstart
5 min
installation first, install the klevu/php sdk library in your application we recommend using composer to ensure dependencies are managed appropriately, and to hook into autoloading automatically you can also install directly from https //github com/klevu/php sdk , and handle autoloading yourself composer require klevu/php sdk retrieve your access tokens next, you will need to locate your js api key and rest auth key for the account you are integrating these can be found under store settings > store info > shop info > integration when logged into https //box klevu com note in our examples we will hardcode these credentials when building your application, you should save and retrieve them from our existing configuration storage create an account credentials object whenever you need to interact with klevu via one of the public services, you will need to provide the credentials above in a standard format in this case, the accountcredentials object create a new php script \<?php declare(strict types=1); use klevu\phpsdk\model\accountcredentials; $accountcredentials = new accountcredentials( jsapikey '\[your js api key]', // eg klevu 1234567890 restauthkey '\[your rest auth key]', // eg abcde1234567890 ); instatiate a service class finally, choose which service you need to interact with; instatiate its service class; and execute your request there are simple code examples for all main services in the how to, some popular ones are listed below account management docid 1t7gunufps0b icokgwar analytics docid\ rdq1zpjutlxhp4yh9xswm indexing docid\ wacvz7cvz6qqv8kknsyrb
