dayvsonspacca / beacon-guzzle-client
Guzzle implementation of the Beacon contracts
Package info
github.com/dayvsonspacca/php-beacon-guzzle-client
pkg:composer/dayvsonspacca/beacon-guzzle-client
v1.0.0
2026-07-09 20:28 UTC
Requires
- php: >=8.4
- dayvsonspacca/beacon-contracts: ^1.0
- guzzlehttp/guzzle: ^7.14
- php-standard-library/json: ^6.2
- php-standard-library/type: ^6.2
- php-standard-library/url: ^6.2
Requires (Dev)
- carthage-software/mago: ^1.43.0
- phpunit/phpunit: ^13.2
README
Guzzle implementation of the Beacon contracts. Install and publish events — no HTTP plumbing to write.
Developed in the php-beacon monorepo; this repository is a read-only split.
Installation
composer require dayvsonspacca/beacon-guzzle-client
The contracts package comes with it.
Usage
use Beacon\Event; use Beacon\Token; use Beacon\Guzzle\GuzzleBeaconClient; use function Psl\URL\parse; $client = new GuzzleBeaconClient( parse('https://beacon.example.com/'), new Token('btk_your_token'), ); $eventId = $client->publish(new Event('user.created', ['id' => 42])); echo $eventId->value;
publish() sends POST /publish with the event as JSON, authenticated with Authorization: Bearer <token>, and returns the EventId generated by the server.