PHPackages                             simplechat/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. simplechat/php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

simplechat/php-sdk
==================

Official PHP SDK for SimpleChat.dev

0667PHP

Since Dec 4Pushed 7mo agoCompare

[ Source](https://github.com/KCESYS/simplechat-php-sdk)[ Packagist](https://packagist.org/packages/simplechat/php-sdk)[ RSS](/packages/simplechat-php-sdk/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

SimpleChat PHP SDK
==================

[](#simplechat-php-sdk)

Official PHP SDK for SimpleChat.dev - Session recording and analytics platform.

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

[](#installation)

```
composer require simplechat/php-sdk
```

Basic Usage
-----------

[](#basic-usage)

```
use SimpleChat\SDK\SimpleChatClient;

$client = new SimpleChatClient('your-api-key');

// Create a session
$session = $client->sessions()->create('user-123', ['plan' => 'premium']);
echo $session['tracking_url'];
echo $session['admin_url'];

// List sessions
$sessions = $client->sessions()->list('active', null, 50, 0);

// Get session
$session = $client->sessions()->get('session-hash');

// Log events
$client->events()->log('session-hash', 'button_click', ['button' => 'signup']);

// Send chat message
$client->chat()->send('session-hash', 'Hello!', 'visitor');
```

Laravel Integration
-------------------

[](#laravel-integration)

### Setup

[](#setup)

Add to `config/services.php`:

```
'simplechat' => [
    'api_key' => env('SIMPLECHAT_API_KEY'),
],
```

Or set in `.env`:

```
SIMPLECHAT_API_KEY=your-api-key

```

### Usage with Facade

[](#usage-with-facade)

```
use SimpleChat\SDK\Laravel\Facades\SimpleChat;

$session = SimpleChat::sessions()->create('user-123');
```

### Usage with Dependency Injection

[](#usage-with-dependency-injection)

```
use SimpleChat\SDK\SimpleChatClient;

class YourController
{
    public function __construct(private SimpleChatClient $simplechat) {}

    public function track()
    {
        $session = $this->simplechat->sessions()->create(auth()->id());
        return response()->json($session);
    }
}
```

API Reference
-------------

[](#api-reference)

### Sessions

[](#sessions)

```
// Create session
$client->sessions()->create(?string $externalId, ?array $metadata): array

// List sessions
$client->sessions()->list(?string $status, ?string $externalId, int $limit, int $offset): array

// Get session
$client->sessions()->get(string $hash): array

// Get tracker URL
$client->sessions()->getTracker(): array
```

### Events

[](#events)

```
// Log single event
$client->events()->log(string $sessionHash, string $type, array $data, ?string $pageUrl): array

// Log batch events
$client->events()->logBatch(string $sessionHash, array $events): array

// List events
$client->events()->list(string $sessionHash, int $afterId): array
```

### Chat

[](#chat)

```
// Send message
$client->chat()->send(string $sessionHash, string $message, string $senderType, ?int $userId): array
```

Exception Handling
------------------

[](#exception-handling)

```
use SimpleChat\SDK\Exceptions\SimpleChatException;
use SimpleChat\SDK\Exceptions\AuthenticationException;
use SimpleChat\SDK\Exceptions\NotFoundException;

try {
    $session = $client->sessions()->create();
} catch (AuthenticationException $e) {
    // Invalid API key
} catch (NotFoundException $e) {
    // Resource not found
} catch (SimpleChatException $e) {
    // Other errors
}
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance45

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/181174959?v=4)[KCESYS Ltd](/maintainers/KCESYS)[@KCESYS](https://github.com/KCESYS)

### Embed Badge

![Health badge](/badges/simplechat-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/simplechat-php-sdk/health.svg)](https://phpackages.com/packages/simplechat-php-sdk)
```

PHPackages © 2026

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