PHPackages                             symfony/mercure - 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. symfony/mercure

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

symfony/mercure
===============

Symfony Mercure Component

v0.7.2(6mo ago)44016.9M↓15.3%44[13 issues](https://github.com/symfony/mercure/issues)[3 PRs](https://github.com/symfony/mercure/pulls)20MITPHPPHP &gt;=8.1CI failing

Since Oct 24Pushed 6mo ago4 watchersCompare

[ Source](https://github.com/symfony/mercure)[ Packagist](https://packagist.org/packages/symfony/mercure)[ Docs](https://symfony.com)[ GitHub Sponsors](https://github.com/dunglas)[ Fund](https://tidelift.com/funding/github/packagist/symfony/mercure)[ RSS](/packages/symfony-mercure/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (10)Versions (23)Used By (20)

Mercure Component
=================

[](#mercure-component)

> Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way. It is especially useful to publish real-time updates of resources served through web APIs, to reactive web and mobile apps.

The Mercure Component implements the "publisher" part of [the Mercure Protocol](https://mercure.rocks).

Getting Started
---------------

[](#getting-started)

```
$ composer require symfony/mercure lcobucci/jwt

```

```
// change these values accordingly to your hub installation
const HUB_URL = 'https://demo.mercure.rocks/.well-known/mercure';
const JWT_SECRET = '!ChangeThisMercureHubJWTSecretKey!';

// Set up the JWT token provider
// Alternatively, you can use the \Symfony\Component\Mercure\Jwt\StaticTokenProvider if you already have a JWT token
$jwFactory = new \Symfony\Component\Mercure\Jwt\LcobucciFactory(JWT_SECRET);
$provider = new \Symfony\Component\Mercure\Jwt\FactoryTokenProvider($jwFactory, publish: ['*']);

$hub = new \Symfony\Component\Mercure\Hub(HUB_URL, $provider);
// Serialize the update, and dispatch it to the hub, that will broadcast it to the clients
$id = $hub->publish(new \Symfony\Component\Mercure\Update('https://example.com/books/1.jsonld', 'Hi from Symfony!'));
```

Resources
---------

[](#resources)

- [Documentation](https://symfony.com/doc/current/mercure.html)
- [Contributing](https://symfony.com/doc/current/contributing/index.html)
- [Report issues](https://github.com/symfony/mercure/issues) and [send Pull Requests](https://github.com/symfony/mercure/pulls)in the [`symfony/mercure` repository](https://github.com/symfony/mercure)

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance66

Regular maintenance activity

Popularity68

Solid adoption and visibility

Community40

Growing community involvement

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~185 days

Total

18

Last Release

200d ago

PHP version history (3 changes)v0.1.0PHP ^7.1.3

v0.4.1PHP &gt;=7.1.3

v0.7.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47313?v=4)[Fabien Potencier](/maintainers/fabpot)[@fabpot](https://github.com/fabpot)

---

Top Contributors

[![dunglas](https://avatars.githubusercontent.com/u/57224?v=4)](https://github.com/dunglas "dunglas (56 commits)")[![azjezz](https://avatars.githubusercontent.com/u/29315886?v=4)](https://github.com/azjezz "azjezz (14 commits)")[![chalasr](https://avatars.githubusercontent.com/u/7502063?v=4)](https://github.com/chalasr "chalasr (13 commits)")[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (7 commits)")[![norkunas](https://avatars.githubusercontent.com/u/2722872?v=4)](https://github.com/norkunas "norkunas (4 commits)")[![veewee](https://avatars.githubusercontent.com/u/1618158?v=4)](https://github.com/veewee "veewee (2 commits)")[![castroCrea](https://avatars.githubusercontent.com/u/20707343?v=4)](https://github.com/castroCrea "castroCrea (2 commits)")[![mvanduijker](https://avatars.githubusercontent.com/u/1771206?v=4)](https://github.com/mvanduijker "mvanduijker (1 commits)")[![qdequippe](https://avatars.githubusercontent.com/u/3193300?v=4)](https://github.com/qdequippe "qdequippe (1 commits)")[![rmikalkenas](https://avatars.githubusercontent.com/u/14221532?v=4)](https://github.com/rmikalkenas "rmikalkenas (1 commits)")[![silverbackdan](https://avatars.githubusercontent.com/u/25174262?v=4)](https://github.com/silverbackdan "silverbackdan (1 commits)")[![Te4g](https://avatars.githubusercontent.com/u/47118498?v=4)](https://github.com/Te4g "Te4g (1 commits)")[![vincentchalamon](https://avatars.githubusercontent.com/u/407859?v=4)](https://github.com/vincentchalamon "vincentchalamon (1 commits)")[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (1 commits)")[![alexandre-daubois](https://avatars.githubusercontent.com/u/2144837?v=4)](https://github.com/alexandre-daubois "alexandre-daubois (1 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (1 commits)")[![B-Galati](https://avatars.githubusercontent.com/u/895123?v=4)](https://github.com/B-Galati "B-Galati (1 commits)")[![chapterjason](https://avatars.githubusercontent.com/u/1337562?v=4)](https://github.com/chapterjason "chapterjason (1 commits)")[![chrishemmings](https://avatars.githubusercontent.com/u/7426965?v=4)](https://github.com/chrishemmings "chrishemmings (1 commits)")[![cvergne](https://avatars.githubusercontent.com/u/1032689?v=4)](https://github.com/cvergne "cvergne (1 commits)")

---

Tags

live-updatesmercurephpserver-sent-eventssubscriptionssymfonypushupdatesssemercure

### Embed Badge

![Health badge](/badges/symfony-mercure/health.svg)

```
[![Health](https://phpackages.com/badges/symfony-mercure/health.svg)](https://phpackages.com/packages/symfony-mercure)
```

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M386](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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