PHPackages                             botika/socket - 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. botika/socket

ActiveLibrary[API Development](/categories/api)

botika/socket
=============

Library for interacting with the Botika Socket REST API

v1.0.8(3y ago)55.1kMITPHPPHP ^7.0 || ^8.0CI passing

Since Sep 8Pushed 3y agoCompare

[ Source](https://github.com/botika-online/botika-socket-http-php)[ Packagist](https://packagist.org/packages/botika/socket)[ RSS](/packages/botika-socket/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (10)Used By (0)

Botika Socket HTTP PHP Library
==============================

[](#botika-socket-http-php-library)

PHP library for interacting with the Botika Socket HTTP API.

Installation
------------

[](#installation)

You can get the Botika Socket PHP library via a composer package called `socket`. See

```
composer require botika/socket
```

Or add to `composer.json`:

```
"require": {
    "botika/socket": "^1.0"
}
```

then run `composer update`.

Supported platforms
-------------------

[](#supported-platforms)

- PHP - supports PHP versions 7.0, and above.

Botika Socket constructor
-------------------------

[](#botika-socket-constructor)

Use the credentials from your Botika Socket application to create a new `Botika\Socket` instance.

```
$baseURL = 'https://socket.example.com';
$username = 'USERNAME';
$password = 'PASSWORD';
$auth = new \Botika\Socket\Auth($username, $password);

// Initialize socket
$socket = new \Botika\Socket\Socket($baseURL, $auth);
```

Logging configuration
---------------------

[](#logging-configuration)

The recommended approach of logging is to use a [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)compliant logger implementing `Psr\Log\LoggerInterface`. The `Socket` object implements `Psr\Log\LoggerAwareInterface`, meaning you call `setLogger(LoggerInterface $logger)` to set the logger instance.

```
// where $logger implements `LoggerInterface`

$socket->setLogger($logger);
```

Publishing/Triggering events
----------------------------

[](#publishingtriggering-events)

To trigger an event on one or more channels use the `trigger` function.

### A single channel

[](#a-single-channel)

```
// Options get from https://docs.guzzlephp.org/en/stable/request-options.html
$options = [];
$socket->trigger('my-channel', 'my_event', 'hello world', $options);
```

### Multiple channels

[](#multiple-channels)

```
// Options get from https://docs.guzzlephp.org/en/stable/request-options.html
$options = [];
$socket->trigger([ 'channel-1', 'channel-2' ], 'my_event', 'hello world', $options);
```

### Asynchronous interface

[](#asynchronous-interface)

Both `trigger` have asynchronous counterparts in `triggerAsync`. These functions return [Guzzle promises](https://github.com/guzzle/promises) which can be chained with `->then`:

```
// Options get from https://docs.guzzlephp.org/en/stable/request-options.html
$options = [];
$promise = $socket->triggerAsync(['channel-1', 'channel-2'], 'my_event', 'hello world', $options);
$promise->then(
    function (ResponseInterface $res) {
        echo $res->getStatusCode() . "\n";
    },
    function (RequestException $e) {
        echo $e->getMessage() . "\n";
        echo $e->getRequest()->getMethod();
    }
);
$promise->wait();
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

9

Last Release

1345d ago

PHP version history (2 changes)v1.0.0PHP ^7.0

v1.0.4PHP ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/48325ef11a09f4c6ffde55d9da8f3458c45949da399541c0aa38bdef8e0fc113?d=identicon)[andripgbyk](/maintainers/andripgbyk)

---

Top Contributors

[![andriykhc](https://avatars.githubusercontent.com/u/140709160?v=4)](https://github.com/andriykhc "andriykhc (19 commits)")[![Slackluky](https://avatars.githubusercontent.com/u/18343107?v=4)](https://github.com/Slackluky "Slackluky (1 commits)")

---

Tags

composerphpsocket

### Embed Badge

![Health badge](/badges/botika-socket/health.svg)

```
[![Health](https://phpackages.com/badges/botika-socket/health.svg)](https://phpackages.com/packages/botika-socket)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
