PHPackages                             klevu/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. klevu/php-sdk

ActiveLibrary[API Development](/categories/api)

klevu/php-sdk
=============

Klevu SDK for PHP

1.1.3(7mo ago)117.0k↓28.5%17MITPHPPHP ~8.1|~8.2|~8.3|~8.4

Since Mar 26Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/klevu/php-sdk)[ Packagist](https://packagist.org/packages/klevu/php-sdk)[ RSS](/packages/klevu-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (13)Versions (18)Used By (7)

klevu/php-sdk
=============

[](#klevuphp-sdk)

The Klevu PHP-SDK is a small package designed to simplify communicating with Klevu API services.

Getting Started
---------------

[](#getting-started)

1. **[Create an account with Klevu](https://box.klevu.com/merchant/signup)**.
    Free trial, with full access to all features is available.
2. Retrieve your **JS API Key** and **REST AUTH Key** from Store Settings &gt; Store Info in your account.
3. **Install the SDK** in your application using composer.

```
composer require klevu/php-sdk

```

4. **Start building!**
    There are some quick-start examples below, as well as detailed guides in our [developer documentation](https://docs.klevu.com/php-sdk).

System Requirements
-------------------

[](#system-requirements)

To use this library, you must be running **PHP 8.1** compiled with the `libxml` and `simplexml` extensions. See the [PHP docs](https://www.php.net/manual/en/simplexml.installation.php) for more information.

You will also require a [PSR-18 compatible](https://www.php-fig.org/psr/psr-18/) HTTP client, such as `guzzlehttp/guzzle`, which provides `psr/http-client-implementation` support. A [list of compatible libraries can be found on Packagist](https://packagist.org/providers/psr/http-client-implementation).

We also recommend a [PSR-3 compatible](https://www.php-fig.org/psr/psr-3/) logger library, such as `monolog/monolog`. This will allow the SDK to write activity it performs to a location of your choice.

Quick Start Guide
-----------------

[](#quick-start-guide)

### Account Credentials

[](#account-credentials)

The [AccountCredentials](src/Model/AccountCredentials.php) object is required by all services connecting with Klevu.
You will need both your JS API Key (in the format `klevu-xxxxxxx`) and your REST AUTH Key from your Klevu account.

> When saving and accessing these credentials within your application, please treat the REST AUTH Key in the same manner as any other sensitive information, such as passwords.
> If you need to change your REST AUTH Key, please [contact our support team](https://help.klevu.com/support/tickets/new).

Create a new `Klevu\PhpSDK\Model\AccountCredentials` object. Note, account credentials objects are immutable.

```
