useburrow/sdk-php
最新稳定版本:v0.9.5
Composer 安装命令:
composer require useburrow/sdk-php
包简介
Burrow PHP SDK for plugin integrations.
README 文档
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.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-18