Skip to content

Repository files navigation

Courier PHP SDK

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

About

A PHP package for communicating with the Courier REST API.

Resources

Security policy

Stars

15 stars

Watchers

16 watching

Forks

Releases

Packages

Used by

Contributors

Languages