Quickstart
5min
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 source \[github] , 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 klevu merchant center 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 retrieve klevu account details analytics send analytics events data indexing send records for indexing