PHPackages                             bootdesk/chat-sdk-adapter-web - 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. bootdesk/chat-sdk-adapter-web

ActiveLibrary[API Development](/categories/api)

bootdesk/chat-sdk-adapter-web
=============================

Web adapter for bootdesk/chat-sdk-core — browser chat UI via JSON request/response

0.4.44(2w ago)0166MITPHPPHP &gt;=8.2

Since Jun 4Pushed 1w agoCompare

[ Source](https://github.com/bootdesk/chat-sdk-adapter-web)[ Packagist](https://packagist.org/packages/bootdesk/chat-sdk-adapter-web)[ RSS](/packages/bootdesk-chat-sdk-adapter-web/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (38)Used By (0)

bootdesk/chat-sdk-adapter-web
=============================

[](#bootdeskchat-sdk-adapter-web)

Generic web/REST adapter for the laravel-bootdesk multi-platform messaging framework.

Install
-------

[](#install)

```
composer require bootdesk/chat-sdk-adapter-web
```

Configuration
-------------

[](#configuration)

```
use BootDesk\ChatSDK\Web\WebAdapter;
use BootDesk\ChatSDK\Web\WebAdapterConfig;
use BootDesk\ChatSDK\Core\Contracts\BroadcastAdapter;
use Psr\Http\Message\ServerRequestInterface;

class MyAppWebConfig extends WebAdapterConfig
{
    public function getUser(ServerRequestInterface $request): ?array
    {
        return auth()->user()
            ? ['id' => (string) auth()->id(), 'name' => auth()->user()?->name]
            : null;
    }

    public function verifySignature(ServerRequestInterface $request): bool|string
    {
        $signature = $request->getHeaderLine('X-Signature');
        $payload = (string) $request->getBody();
        $expected = 'sha256=' . hash_hmac('sha256', $payload, config('app.webhook_secret'));
        return hash_equals($expected, $signature) ? true : 'Invalid signature';
    }
}

$adapter = new WebAdapter(
    userName: env('WEB_USER_NAME', 'Bot'),
    config: new MyAppWebConfig,
    broadcaster: $broadcaster,  // Optional: BroadcastAdapter instance
    asyncMode: true,             // Optional: Enable async broadcasting
);
```

**Laravel config** (`config/chat.php`):

```
'web' => [
    'user_name' => env('BOT_USERNAME', 'Bot'),
    'config' => App\Chat\WebAdapterConfig::class,  // extends BootDesk\ChatSDK\Web\WebAdapterConfig
    'broadcaster' => fn () => app(BroadcastAdapter::class),
    'async_mode' => env('CHAT_WEB_ASYNC_MODE', false),
],
```

The `verifySignature()` method receives the PSR-7 request and must return `true` for valid, or an error message string for invalid. Called before user auth.

Quick Example
-------------

[](#quick-example)

```
// Post a message in a web session
$adapter->postMessage('web:session-abc123', 'Hello from laravel-bootdesk!');

// Handle incoming webhook
// POST body: {"text": "Hi", "userId": "user-1", "sessionId": "session-abc123"}
```

Thread ID Format
----------------

[](#thread-id-format)

FormatDescription`web:{userId}:{conversationId}`User-conversation threadingWebhook
-------

[](#webhook)

Accepts POST requests with a JSON body:

```
{
  "id": "optional-conversation-id",
  "messages": [
    {
      "role": "user",
      "id": "msg-1",
      "text": "Hello",
      "attachments": [
        {"url": "https://example.com/file.pdf", "name": "Document", "type": "file"}
      ]
    }
  ]
}
```

Authentication via `$getUser` closure — receives PSR-7 ServerRequestInterface, must return `['id' => string, 'name' => ?string]` or `null` for 401.

Feature Matrix
--------------

[](#feature-matrix)

FeatureSupportedPost messages✓Edit messages✓Delete messages✓Reactions✓Typing indicator✓Fetch messages✓Fetch thread info✓Fetch channel info✗Get user✗Open DM✓Stream✓Broadcasting✓Broadcasting
------------

[](#broadcasting)

WebAdapter supports real-time event broadcasting via `BroadcastAdapter`:

```
use BootDesk\ChatSDK\Core\Contracts\BroadcastAdapter;

$broadcaster = app(BroadcastAdapter::class);

$adapter = new WebAdapter(
    userName: 'Bot',
    config: new MyAppWebConfig,
    broadcaster: $broadcaster,
    asyncMode: true,  // Broadcast immediately; sync mode accumulates events
);
```

Broadcast events: `MessagePostedEvent`, `MessageEditedEvent`, `MessageDeletedEvent`, `ReactionAddedEvent`, `ReactionRemovedEvent`, `TypingStartedEvent`, `StreamingChunkEvent`, `DirectMessageRequestedEvent`.

User-specific broadcasts (DMs, typing in DMs, streaming) use `broadcastToUser()` with `PrivateChannel`. Thread events use `broadcast()` with public `Channel`.

Notes
-----

[](#notes)

Generic adapter for web/REST integrations. Responses returned via `createResponse()` as JSON: `{id, role: "assistant", text, events: []}`.

Documentation
-------------

[](#documentation)

Full API documentation:

License
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance97

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

37

Last Release

14d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3874705?v=4)[Vin](/maintainers/tryvin)[@tryvin](https://github.com/tryvin)

---

Top Contributors

[![tryvin](https://avatars.githubusercontent.com/u/3874705?v=4)](https://github.com/tryvin "tryvin (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bootdesk-chat-sdk-adapter-web/health.svg)

```
[![Health](https://phpackages.com/badges/bootdesk-chat-sdk-adapter-web/health.svg)](https://phpackages.com/packages/bootdesk-chat-sdk-adapter-web)
```

###  Alternatives

[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k18](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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