PHPackages                             andersundsehr/server-send-events - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. andersundsehr/server-send-events

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andersundsehr/server-send-events
================================

Utility Package to help with the creation of text/event-stream

1.0.4(1y ago)01.5kGPL-2.0-or-laterPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0CI passing

Since Jun 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/andersundsehr/server-send-events)[ Packagist](https://packagist.org/packages/andersundsehr/server-send-events)[ RSS](/packages/andersundsehr-server-send-events/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

erver-send-events package
=========================

[](#erver-send-events-package)

install
-------

[](#install)

```
composer req andersundsehr/server-send-events
```

what does it do
---------------

[](#what-does-it-do)

it makes it easy to use the `text/event-stream` (Server Send Events).

inside your Controller:

```
if (ServerSendEventStream::isEventStream($this->request)) {
    $stream = new ServerSendEventStream();
    $trigger = new FileEventTrigger($stream);

    $stopTime = time() + (5 * 60);
    do {
        $stream->sendMessage($this->getInfo()); // is send to the JS long running script

        $trigger->sleepUntilTrigger('changed-' . $currentUser->getUid(), $stopTime);
    } while (time() < $stopTime);
    die();
}
```

somewhere else in the code:

```
(new FileEventTrigger())->trigger('changed-' . $currentUser->getUid());
```

in your JS

```
//EventSource as an auto restart :)
const evtSource = new EventSource(url, {
  withCredentials: true,
});
evtSource.addEventListener("message", (e) => {
  const data = JSON.parse(e.data);
  // do stuff with the data
  // data comes from $stream->sendMessage()
});
```

with ♥️ from anders und sehr GmbH
=================================

[](#with-️-from-anders-und-sehr-gmbh)

> If something did not work 😮
> or you appreciate this Extension 🥰 let us know.

> We are hiring

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance47

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~173 days

Total

5

Last Release

397d ago

PHP version history (2 changes)1.0.0PHP ~8.2.0

1.0.4PHP ~8.2.0 || ~8.3.0 || ~8.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/471387?v=4)[Matthias Vogel](/maintainers/Kanti)[@Kanti](https://github.com/Kanti)

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

---

Top Contributors

[![Kanti](https://avatars.githubusercontent.com/u/471387?v=4)](https://github.com/Kanti "Kanti (7 commits)")

### Embed Badge

![Health badge](/badges/andersundsehr-server-send-events/health.svg)

```
[![Health](https://phpackages.com/badges/andersundsehr-server-send-events/health.svg)](https://phpackages.com/packages/andersundsehr-server-send-events)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[razorpay/ifsc

Razorpay IFSC Codes Library

384204.4k](/packages/razorpay-ifsc)[anthropic-ai/sdk

Anthropic PHP SDK

160372.1k14](/packages/anthropic-ai-sdk)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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