---
title: Quickstart
slug: php-sdk/quickstart
docTags: 
createdAt: 2023-03-22T16:52:09.000Z
---

# 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\]](https://github.com/klevu/php-sdk), and handle autoloading yourself.

```shell
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](https://box.klevu.com).

![](https://api.archbee.com/api/optimize/816_4eGYZQxALlijMlcBN/2N6gc-Ww_NhBwcfExYb4n_image.png)

:::hint{type="info"}
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
<?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&#x20;

Finally, choose which service you need to interact with; instatiate its service class; and execute your request.&#x20;

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](docId:1t7gUNUfpS0b-ICOkGwAr)
- Analytics : [Send Analytics Events Data](docId\:rdq1zpjutlXhP4yH9xsWm)
- Indexing : [Send Records for Indexing](docId\:wacVz7cvZ6qQV8kkNSyRB)

