thenativeweb / eventsourcingdb
The official PHP client SDK for EventSourcingDB.
Package info
github.com/thenativeweb/eventsourcingdb-client-php
pkg:composer/thenativeweb/eventsourcingdb
Requires
- php: >=8.2
- ext-curl: *
- ext-openssl: *
- ext-sodium: *
- testcontainers/testcontainers: ^1.2.1
Requires (Dev)
- phpstan/phpstan: 2.3.5
- phpunit/phpunit: 11.5.50
- rector/rector: 2.8.4
- symplify/easy-coding-standard: 13.3.13
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.0
- 1.6.0
- 1.5.10
- 1.5.9
- 1.5.8
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- 0.8.0
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.1
- 0.3.0
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.0
This package is auto-updated.
Last update: 2026-11-20 16:48:13 UTC
README
The official PHP client SDK for EventSourcingDB – a purpose-built database for event sourcing.
The complete documentation of this client SDK, including preconditions, EventQL, observing events, handling errors, Testcontainers, and upgrading, is available at https://www.eventfoundation.io/docs/eventsourcingdb/sdks/php.
Getting Started
Install the client SDK:
composer require thenativeweb/eventsourcingdb
Create a client with the URL of your EventSourcingDB instance and the API token to use, and check whether the instance is reachable:
require __DIR__ . '/vendor/autoload.php'; use Thenativeweb\Eventsourcingdb\Client; $client = new Client('http://localhost:3000', 'secret'); $client->ping();
Write an event:
use Thenativeweb\Eventsourcingdb\EventCandidate; $writtenEvents = $client->writeEvents([ new EventCandidate( 'https://library.eventsourcingdb.io', '/books/42', 'io.eventsourcingdb.library.book-acquired', [ 'title' => '2001 – A Space Odyssey', 'author' => 'Arthur C. Clarke', 'isbn' => '978-0756906788', ], ), ]);
Read the events of a subject:
use Thenativeweb\Eventsourcingdb\ReadEventsOptions; $events = $client->readEvents( '/books/42', new ReadEventsOptions( recursive: false, ), ); foreach ($events as $event) { // ... }
For everything else, see the complete documentation.