trycourier / courier
Courier PHP SDK
v5.17.2
2026-08-14 00:07 UTC
Requires
- php: ^8.1
- php-http/discovery: ^1
- psr/http-client: ^1
- psr/http-client-implementation: ^1
- psr/http-factory-implementation: ^1
- psr/http-message: ^1|^2
Requires (Dev)
This package is auto-updated.
Last update: 2026-08-14 00:07:59 UTC
README
The Courier PHP SDK provides typed access to the Courier REST API from PHP applications. Use it to send notifications, manage user profiles, check message status, issue JWT tokens for client-side SDKs, and more.
Installation
The package is not on Packagist, so add the repository to your composer.json first:
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/trycourier/courier-php.git" }
]
}
Then require it:
composer require trycourier/courier-php
Requires PHP 8.1+.
Quick Start
<?php use Courier\Client; $client = new Client(apiKey: getenv('COURIER_API_KEY')); $response = $client->send->message( message: [ 'to' => ['userID' => 'your_user_id'], 'template' => 'your_template_id', 'data' => ['foo' => 'bar'], ], ); var_dump($response->requestId);
The client reads COURIER_API_KEY from your environment automatically.
Documentation
Full documentation: courier.com/docs/sdk-libraries/php