Skip to content

Install

Requirements

  • PHP 8.2 or newer
  • Composer
  • For the client: any PSR-18 HTTP client (Guzzle, Symfony HttpClient, …). Laravel already ships one.

The SDK

composer require praveendias1180/a2a-php

Pre-1.0

Versions are 0.x until 1.0, so minor releases may still change the API. Pin a minor version (^0.2) and read the changelog before upgrading.

Faster protobuf (optional)

The wire types run on the pure-PHP protobuf runtime, with no extension needed. For heavy traffic, install the C extension; the SDK uses it automatically:

pecl install protobuf

Laravel

composer require praveendias1180/a2a-laravel
php artisan vendor:publish --tag=a2a-migrations
php artisan migrate

The service provider registers itself through package discovery. Publish the config too (--tag=a2a-config) to change the runner, queue or storage. Laravel 12 and 13 are tested (11 is allowed, but Composer blocks its releases for security advisories). See the Laravel guide.

Check it works

use A2A\Types\Task;

$task = new Task();
$task->mergeFromJsonString('{"id":"task-1","status":{"state":"TASK_STATE_COMPLETED"}}');

echo $task->serializeToJsonString();
// {"id":"task-1","status":{"state":"TASK_STATE_COMPLETED"}}