senderkit / senderkit-php
Official SenderKit PHP SDK — email, SMS, push & web-push.
v0.2.0
2026-06-11 23:21 UTC
Requires
- php: >=8.1
- php-http/discovery: ^1.19
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1 || ^2.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.8
- nyholm/psr7: ^1.8
- php-http/mock-client: ^1.6
- phpunit/phpunit: ^10.5
- symfony/yaml: ^6.4 || ^7.0
Suggests
- guzzlehttp/guzzle: A PSR-18 client with timeout support (used automatically if installed).
- symfony/http-client: Alternative PSR-18 client.
README
The official PHP SDK for SenderKit — send transactional email, SMS, push, and web-push from PHP.
Requirements
- PHP 8.1+
- Any PSR-18 HTTP client (e.g. Guzzle or
symfony/http-client) — auto-discovered, or inject your own.
Install
composer require senderkit/senderkit-php
Quick start
use SenderKit\Client; use SenderKit\Request\TemplateSend; $sk = new Client(apiKey: getenv('SENDERKIT_API_KEY')); // sk_live_… or sk_test_… $result = $sk->send(new TemplateSend( template: 'welcome', to: 'user@example.com', vars: ['name' => 'Ada'], )); echo $result->id; // msg_… echo $result->status; // queued | scheduled
Raw send
use SenderKit\Request\{RawSend, EmailContent}; $sk->sendRaw(new RawSend( to: 'user@example.com', content: new EmailContent(subject: 'Receipt', html: '<p>Thanks for your order.</p>'), metadata: ['source' => 'checkout'], ));
Webhooks
use SenderKit\Webhook\WebhookVerifier; $event = (new WebhookVerifier)->verify( rawBody: $rawRequestBody, signatureHeader: $request->header('X-SenderKit-Signature'), secret: getenv('SENDERKIT_WEBHOOK_SECRET'), // whsec_… ); echo $event->type; // message.delivered, message.failed, …
Documentation
- API reference: https://senderkit.com/docs
- OpenAPI spec: https://senderkit.com/openapi.yaml