sveda-ai / php-sdk
PHP SDK for the Sveda AI sidecar HTTP API (embed tokens, streaming chat, histories).
v0.1.0
2026-09-16 06:37 UTC
Requires
- php: ^8.4
- guzzlehttp/guzzle: ^7.9
- psr/http-client: ^1.0
- psr/http-message: ^2.0
Requires (Dev)
- phpunit/phpunit: ^11.0 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Framework-agnostic PHP SDK for the Sveda AI sidecar HTTP API.
Packagist: sveda-ai/php-sdk
Install
composer require sveda-ai/php-sdk
Usage
use Sveda\Client\Factory; $client = Factory::factory() ->withBaseUri('https://sveda.example.com') ->withHostApiKey($hostKey) ->make(); $session = $client->embed()->createToken([ 'visitor_id' => 'user-1', 'host_mcp_url' => 'https://app.test/mcp/sveda', 'host_mcp_token' => $mcpToken, ]); $client = Factory::factory() ->withBaseUri('https://sveda.example.com') ->withEmbedToken($session->token) ->make(); foreach ($client->chat()->createStreamed([ 'messages' => [['role' => 'user', 'content' => 'Hello']], 'chatId' => 'chat-1', ]) as $event) { echo $event->type."\n"; }
License
MIT