useburrow / sdk-php
Burrow PHP SDK for plugin integrations.
v0.9.5
2026-03-26 13:09 UTC
Requires
- php: ^8.2
Requires (Dev)
- phpunit/phpunit: ^11.0
README
Official PHP SDK for integrating WordPress, Craft, Statamic, ExpressionEngine, and other PHP plugin ecosystems or frameworks with the Burrow platform.
What Burrow Does
Burrow helps plugin teams turn product activity into reliable, structured signals that power onboarding visibility, operational automation, and product analytics.
With Burrow, plugins can:
- discover and link tenant/project context
- publish canonical events across forms, ecommerce, and system channels
- keep historical backfills aligned with real source timestamps
- route data safely with scoped ingestion keys and project guards
- use retry + outbox primitives for durable delivery
Why Use This SDK
This SDK provides a framework-agnostic integration layer so plugin code can stay focused on CMS specifics while Burrow concerns stay centralized:
- typed client for onboarding, contracts, events, and backfill APIs
- canonical event envelope builders and validation helpers
- retry-aware transport and normalized API error classification
- in-memory and SQL outbox building blocks for resilient event dispatch
Installation
composer require useburrow/sdk-php
Requirements
- PHP 8.2+
Quick Start
use Burrow\Sdk\Client\BurrowClient; use Burrow\Sdk\Transport\CurlHttpTransport; use Burrow\Sdk\Transport\RetryPolicy; $transport = new CurlHttpTransport( timeoutSeconds: 8, retryPolicy: new RetryPolicy(maxAttempts: 3, baseDelayMilliseconds: 200) ); $client = new BurrowClient( baseUrl: 'https://app.useburrow.com', apiKey: 'your-plugin-api-key', transport: $transport );
Typical Plugin Flow
- Call onboarding discover/link during plugin setup.
- Submit/fetch forms contracts and persist mapping metadata.
- Publish real-time canonical events as plugin activity occurs.
- Run historical backfill after contract setup is finalized.
- Use outbox delivery for idempotent retries and outage resilience.
Example: Publish an Event
use Burrow\Sdk\Events\EventEnvelopeBuilder; $event = EventEnvelopeBuilder::build([ 'organizationId' => 'org_123', 'clientId' => 'cli_123', 'channel' => 'forms', 'event' => 'forms.submission.received', 'timestamp' => gmdate('c'), 'properties' => ['submissionId' => 'sub_123'], 'tags' => ['formId' => 'contact'], ]); $client->publishEvent($event);
Development
composer install
composer test
License
MIT. See LICENSE.