PHPackages                             pbergman/ntfy-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. pbergman/ntfy-php

ActiveLibrary

pbergman/ntfy-php
=================

Library to push messages to a ntfy server

1.2.0(2y ago)1296↓100%1PHPPHP ^7.4||^8.0

Since Oct 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pbergman/ntfy-php)[ Packagist](https://packagist.org/packages/pbergman/ntfy-php)[ RSS](/packages/pbergman-ntfy-php/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (6)Versions (11)Used By (1)

PHP NTFY
========

[](#php-ntfy)

A php library for publishing and subscribing messages to or from a [ntfy](https://ntfy.sh/) server.

### Client

[](#client)

```
use PBergman\Ntfy\Api\Client;
use Symfony\Component\HttpClient\HttpClient;

$client = new Client(
    HttpClient::create([
        'base_uri' => 'https://ntfy.sh',
    ]),
);

```

For authentication the `auth_basic` or `auth_bearer` can be used or use a [AuthenticationInterface](src%2FAuthentication%2FAuthenticationInterface.php) as second argument:

```
use PBergman\Ntfy\Api\Client;
use PBergman\Ntfy\Authentication\BasicAuthentication;
use Symfony\Component\HttpClient\HttpClient;

$client = new Client(
    HttpClient::create([
        'base_uri' => 'https://ntfy.sh',
    ]),
    new BasicAuthentication('username', 'password')
);

```

### Publishing

[](#publishing)

#### Simple message

[](#simple-message)

```
use PBergman\Ntfy\Model\PublishParameters;
use PBergman\Ntfy\Model\HttpAction;

$message = new PublishParameters('Hello world test!!!', 'Test title');
$message->setTags(['foo', 'bar']);
$message->addAction(new HttpAction('Google', 'https://google.nl'));

$response = $client->publish('test', $message);
// will return a async response...
$response()->getId()

```

#### with Attachment

[](#with-attachment)

```
use PBergman\Ntfy\Model\PublishParameters;
use PBergman\Ntfy\Model\HttpAction;

if (false !== $body = file_get_contents('out.txt')) {

    $message = new PublishParameters('Hello world test!!!', 'Test title');
    $message->setFilename('out.txt')
    $message->setTags(['foo', 'bar']);
    $message->addAction(new HttpAction('Google', 'https://google.nl'));

    $client->publish('test', $message, $body);
}

```

### Subscribing

[](#subscribing)

```
use PBergman\Ntfy\Model\SubscribeParameters;

$params = new SubscribeParameters();
$params->setSince('all');

foreach ($client->subscribe('test', $params) as $response) {
    printf("[%s] %s | %s\n", (new \DateTime('@' . $response->getTime()))->format(\DateTime::ATOM), $response->getTitle(), $response->getMessage());
}

```

Or to retrieve all message after a given id

```
use PBergman\Ntfy\Model\SubscribeParameters;

$params = new SubscribeParameters();
$params->setSince('XXXXXXXXXX');
$params->setPoll(true);

$messages = \iterator_to_array($client->subscribe('test', $params));

```

###  Health Score

27

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

10

Last Release

882d ago

### Community

Maintainers

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

---

Top Contributors

[![pbergman](https://avatars.githubusercontent.com/u/1193198?v=4)](https://github.com/pbergman "pbergman (11 commits)")

### Embed Badge

![Health badge](/badges/pbergman-ntfy-php/health.svg)

```
[![Health](https://phpackages.com/badges/pbergman-ntfy-php/health.svg)](https://phpackages.com/packages/pbergman-ntfy-php)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[oro/platform

Business Application Platform (BAP)

648132.0k74](/packages/oro-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.1k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

605.0M338](/packages/shopware-core)[sensiolabs/minify-bundle

Assets Minifier (CSS, JS) for Symfony &amp; Minify integration in Asset Mapper

5678.5k1](/packages/sensiolabs-minify-bundle)

PHPackages © 2026

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