PHPackages                             dru1x/expo-server-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dru1x/expo-server-sdk-php

ActiveLibrary

dru1x/expo-server-sdk-php
=========================

Server-side library for working with the Expo push notification service using PHP 8.2+

0.8.0(2mo ago)25.1k1[1 PRs](https://github.com/dru1x/expo-server-sdk-php/pulls)MITPHPPHP &gt;=8.2CI passing

Since Jun 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/dru1x/expo-server-sdk-php)[ Packagist](https://packagist.org/packages/dru1x/expo-server-sdk-php)[ Docs](https://github.com/dru1x/expo-server-sdk-php)[ RSS](/packages/dru1x-expo-server-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (6)Versions (12)Used By (0)

Expo Push Server SDK (PHP)
==========================

[](#expo-push-server-sdk-php)

[![Test Workflow Status](https://github.com/Dru1X/expo-server-sdk-php/workflows/Test/badge.svg)](https://github.com/Dru1X/expo-server-sdk-php/workflows/Test/badge.svg)

Server-side library for working with the Expo Push service using PHP 8.2+

⚙ Installation
--------------

[](#-installation)

### Requirements

[](#requirements)

- [PHP 8.2+](https://php.net/releases)
- [PHP Zlib extension](https://www.php.net/manual/en/book.zlib.php)

### Instructions

[](#instructions)

Install the library with composer:

```
composer require dru1x/expo-server-sdk-php
```

🚀 Usage
-------

[](#-usage)

First, instantiate the `ExpoPush` service:

```
use Dru1x\ExpoPush\ExpoPush;

$expoPush = new ExpoPush();
```

If [additional security](https://docs.expo.dev/push-notifications/sending-notifications/#additional-security) is being used, the access token can be supplied as an argument to the constructor:

```
use Dru1x\ExpoPush\ExpoPush;

$accessToken = 'NTLyMHB2vtZ1lWhgP0sjWJTOCed9zspT';
$expoPush    = new ExpoPush($accessToken);
```

### Sending Push Notifications

[](#sending-push-notifications)

Push notifications can be sent by supplying a `PushMessageCollection`, or an array of `PushMessage` objects, to the `sendNotifications()` method. This automatically chunks the given push messages into an appropriate number of requests and sends them concurrently to Expo's Push API. The max request size, concurrency limit and rate limit are applied as set out in [Expo's Push API documentation](https://docs.expo.dev/push-notifications/sending-notifications/#http2-api). Therefore, the maximum throughput of this method is 600 notifications per second.

```
use Dru1x\ExpoPush\PushError\PushErrorCollection;
use Dru1x\ExpoPush\PushMessage\PushMessageCollection;
use Dru1x\ExpoPush\PushMessage\PushMessage;
use Dru1x\ExpoPush\PushTicket\PushTicketCollection;
use Dru1x\ExpoPush\PushToken\PushToken;

// This could also be an array of PushMessage objects
$messages = new PushMessageCollection(
    new PushMessage(
        to: new PushToken('ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]'),
        title: 'Hello',
        body: 'This is a push notification'
    )
);

$result = $expoPush->sendNotifications($messages);

/** @var PushTicketCollection $tickets */
$tickets = $result->tickets;

/** @var PushErrorCollection|null $errors */
$errors = $result->errors;
```

The `SendNotificationsResult` object returned by `sendNotifications()` contains a collection of all the resulting `PushTicket` objects, as well as a collection of `PushError` objects representing any [request-level errors](https://docs.expo.dev/push-notifications/sending-notifications/#request-errors) encountered while sending the given batch of notifications.

The `PushTicketCollection` is ordered according to the order of the `PushMessage` objects passed in to `sendNotifications()`. Each `PushTicket` will either be a `SuccessfulPushTicket` or a `FailedPushTicket`, the latter representing a ticket that was returned with a status of "error".

If errors were encountered, they will be present in the `PushErrorCollection`, and the `PushTicketCollection` will have a gap in its keys that corresponds to the failed chunk of notifications. Inspect the errors to find out what went wrong.

### Checking Tickets

[](#checking-tickets)

Once notifications have been sent, Expo recommends that [notification outcomes are checked](https://docs.expo.dev/push-notifications/sending-notifications/#check-push-receipts-for-errors). This is done by fetching `PushReceipt` objects, each identified by an ID included in a previously returned `PushTicket`.

Receipts can be fetched by supplying a `PushReceiptIdCollection`, or an array of push receipt ID strings, to the `getReceipts()` method. This also automatically chunks the given receipt IDs into an appropriate number of requests and sends them concurrently to the Expo Push API.

Expo recommends that this is done between 15 minutes and 24 hours after notifications were sent.

```
use Dru1x\ExpoPush\PushError\PushErrorCollection;
use Dru1x\ExpoPush\PushReceipt\PushReceiptIdCollection;
use Dru1x\ExpoPush\PushReceipt\PushReceiptCollection;

// This could also be an array of receipt ID strings
$receiptIds = new PushReceiptIdCollection(
    'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
    'YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY',
);

$result = $expoPush->getReceipts($receiptIds);

/** @var PushReceiptCollection $receipts */
$receipts = $result->receipts;

/** @var PushErrorCollection|null $errors */
$errors = $result->errors;
```

The `GetReceiptsResult` object returned by `getReceipts()` contains a collection of the resulting `PushReceipt` objects, as well as a collection of `PushError` objects representing any [request-level errors](https://docs.expo.dev/push-notifications/sending-notifications/#request-errors) encountered while getting the given batch of receipts.

The `PushReceiptCollection` respects the order of receipts returned by the Expo Push API. To find a specific receipt in the collection, the `getById()` method can be used. Each `PushReceipt` with either be a `SuccessfulPushReceipt` or a `FailedPushReceipt`, the latter representing a receipt that was returned with a status of "error".

If errors were encountered, they will be present in the `PushErrorCollection`, and the `PushReceiptCollection` will have a gap in its keys that corresponds to the failed chunk of notifications. Inspect the errors to find out what went wrong.

### Further Information

[](#further-information)

More detailed information about Expo's Push API can be found on their [documentation website](https://docs.expo.dev/push-notifications/sending-notifications/).

💬 Support
---------

[](#-support)

Please report any problems by submitting an [issue](https://github.com/Dru1X/expo-server-sdk-php/issues). Ensure that the problem is well-described and can be replicated by others. All issues will be reviewed as soon as is reasonably possible.

🤝 Contributing
--------------

[](#-contributing)

Thank you for considering contributing! Please open a [pull request](https://github.com/Dru1X/expo-server-sdk-php/pulls), ensuring that test coverage is maintained or increased with any proposed changes. All pull requests will be reviewed as soon as is reasonably possible.

📄 License
---------

[](#-license)

Expo Push Server SDK (PHP) is open-sourced software licensed under the [MIT licence](LICENSE.md).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance93

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Total

9

Last Release

65d ago

PHP version history (2 changes)0.1.0PHP &gt;=8.4

0.2.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c81e642659f4cb101374d5963ff7af8353f05dde91dfbb92086fedfbc370b29f?d=identicon)[dru1x](/maintainers/dru1x)

---

Top Contributors

[![dru1x](https://avatars.githubusercontent.com/u/9990761?v=4)](https://github.com/dru1x "dru1x (41 commits)")[![liamduckett](https://avatars.githubusercontent.com/u/116881406?v=4)](https://github.com/liamduckett "liamduckett (5 commits)")

---

Tags

expo-push-apiexpo-push-notificationsphpphp-8php-librarysdkphppushexpoexpo-server-sdk-php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dru1x-expo-server-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/dru1x-expo-server-sdk-php/health.svg)](https://phpackages.com/packages/dru1x-expo-server-sdk-php)
```

###  Alternatives

[ctwillie/expo-server-sdk-php

Server-side library for working with Expo using PHP

63686.3k1](/packages/ctwillie-expo-server-sdk-php)[sandorian/moneybird-api-php

Moneybird API client for PHP

127.3k](/packages/sandorian-moneybird-api-php)[joetannenbaum/phpushbullet

PHP API wrapper for Pushbullet.

3146.4k4](/packages/joetannenbaum-phpushbullet)[wandesnet/mercadopago-laravel

PHP SDK for integration with Mercado Pago

252.4k](/packages/wandesnet-mercadopago-laravel)[marceloeatworld/falai-php

Professional PHP client for the fal.ai serverless AI platform

105.5k](/packages/marceloeatworld-falai-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
