synerise/php-sdk

There is no license information available for the latest version (0.6.1) of this package.

SDK allowing basic integration with Synerise API

0.6.1 2025-09-09 13:00 UTC

This package is not auto-updated.

Last update: 2025-09-09 13:01:37 UTC


README

About

Synerise SDK for PHP. Allows access to Synerise APIs and overall integration.

Requirements

  • A Synerise workspace API Key
  • PHP 7.4+

Installing Synerise SDK with Composer

SDK is available over packagist. Some dependencies are optional and can be replaced with custom implementations

  1. You can install it with the following command:
composer require synerise/php-sdk
  1. Install suggested dependencies
composer require mobiledetect/mobiledetectlib

Initialization

The repository provides autogenerated api clients that can be utilized on their own. There's also a single entry point ClientBuilder which helps to initialize and authorized all the apis.

Using ClientBuilder

ClientBuilder requires a Synerise\Sdk\Api\Config implementation, which would contain the set of api settings.

  1. Initializing the api with ClientBuilder:
use Synerise\Sdk\Api\ClientBuilder;
use Synerise\Sdk\Api\Config;

/** @var Config $config implementation of Config interface */
$clientBuilder = new ClientBuilder($config);
  1. Optionally you can also provide your own RequestAdapter:
use Microsoft\Kiota\Abstractions\RequestAdapter;
use Synerise\Sdk\Api\ClientBuilder;
use Synerise\Sdk\Api\Config;

/** 
 * @var Config $config implementation of Config interface 
 * @var RequestAdapter $requestAdapter implementation of RequestAdapter interface
 */
$clientBuilder = new ClientBuilder($config, $requestAdapter);

Token Caching

The SDK supports token caching to reduce authentication requests:

With PSR Cache (Recommended)

// Install cache implementation
composer require symfony/cache

use Symfony\Component\Cache\Adapter\RedisAdapter;
use Synerise\Sdk\Api\Authentication\TokenProviderFactory;

$cache = new RedisAdapter(RedisAdapter::createConnection('redis://localhost'));
$tokenProvider = TokenProviderFactory::createWithPsrCache($config, $cache);

Changelog

Changelog can be found here.

Author

Synerise, developer@synerise.com. If you need support please feel free to contact us.