dayvsonspacca/beacon-guzzle-client

Guzzle implementation of the Beacon contracts

Maintainers

Package info

github.com/dayvsonspacca/php-beacon-guzzle-client

pkg:composer/dayvsonspacca/beacon-guzzle-client

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 1

Stars: 0

Open Issues: 0

v1.0.0 2026-07-09 20:28 UTC

This package is auto-updated.

Last update: 2026-07-09 20:45:10 UTC


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.

License

MIT