viames / s2s-client-php
php sdk wildix
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
- firebase/php-jwt: ^7.0
- guzzlehttp/guzzle: ^7.15.2
Requires (Dev)
- mockery/mockery: ^1.6.15
- php-mock/php-mock-phpunit: ^2.15
- phpunit/phpunit: ^9.6.36
- squizlabs/php_codesniffer: ^3.13
Suggests
None
Provides
None
Conflicts
None
Replaces
- wildix/s2s-client-php: 3.0.0
This package is auto-updated.
Last update: 2026-09-03 10:45:29 UTC
README
Unofficial community fork. This package is independently maintained and is not affiliated with or endorsed by Wildix. It is based on the Wildix S2S PHP client and keeps the original
Wildix\\PHP namespace so existing applications can migrate without source-code changes.
Wildix Integration is a PHP HTTP client that makes it easy to send HTTP requests and integrate with Wildix web services.
Version 3 requires Guzzle 7.15.2 or newer, Firebase PHP-JWT 7, and an S2S secret key of at least 32 bytes. Public Wildix client classes, methods, HTTP verbs, endpoints, and request option names remain unchanged from version 2. The internal request DTO no longer implements the PSR-7 request interface because its established getBody() method returns an array rather than a stream.
composer require viames/s2s-client-php:^3.0
Composer treats this package as a replacement for wildix/s2s-client-php at the same version. Do not require both packages in the same project.
Example
Create instance
$config = [ 'host' => 'https://example-host.com', 'app_id' => 'APP_ID', 'secret_key' => 'APP_SECRET', 'app_name' => 'APP_NAME', ]; $client = new \Wildix\Integrations\Client($config, []);
Create custom instance defaults
The client accepts the standard Guzzle request options.
$config = [ 'host' => 'https://example-host.com', 'app_id' => 'APP_ID', 'secret_key' => 'APP_SECRET', 'app_name' => 'APP_NAME', ]; //example params $params = [ // You can set any number of default request options. 'timeout' => 2.0 ]; $client = new \Wildix\Integrations\Client($config, $params);
Example 'GET' query
$options = [ 'params' => [ 'param1'=>'value1', 'param2'=>'value2', ] ]; $response = $client->get('/api/v1/example/', $options); echo $response->getStatusCode(); // 200 echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8' echo $response->getBody()->getContents(); // '{"type": "result", "result": {}}'
Request method aliases
$client->get(apiPoint[, $options])
$client->delete(apiPoint[, $options])
$client->post(apiPoint[, $options])
$client->put(apiPoint[, $options])
Examples
For convenience aliases have been provided for supported request methods. $options = [ 'params' => [ 'param1'=>'value1', 'param2'=>'value2', ], 'body' => [ 'field1'=>'value1', 'field2'=>'value2', ], 'headers' => [ 'content-type' => 'application/json' ] ]; $client->post(apiPoint[, $options]);
Request options config
$options = [ // 'params' are the URL parameters to be sent with the request 'params' => [ 'param1'=>'value1', 'param2'=>'value2', ], // 'body' is the data to be sent as the request body 'body' => [ 'field1'=>'value1', 'field2'=>'value2', ], // 'headers' are custom headers to be sent 'headers' => [ 'content-type' => 'application/json' ] ];