PHPackages                             detain/phlex-shared - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. detain/phlex-shared

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

detain/phlex-shared
===================

Shared interfaces, DTOs, event names, and protocol types used by both phlix-server and phlix-hub. Composer-installable, PHP 8.3+, zero I/O.

v0.7.0(1w ago)062MITPHPPHP ^8.3CI passing

Since May 17Pushed 6d agoCompare

[ Source](https://github.com/detain/phlix-shared)[ Packagist](https://packagist.org/packages/detain/phlex-shared)[ RSS](/packages/detain-phlex-shared/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (10)Used By (2)

detain/phlix-shared
===================

[](#detainphlix-shared)

[![CI](https://github.com/detain/phlix-shared/actions/workflows/ci.yml/badge.svg)](https://github.com/detain/phlix-shared/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/bfbe52521ff743f19fa10dd8ca09d92c75f45b0e7fa376484b4591ccf4c605e6/68747470733a2f2f636f6465636f762e696f2f67682f64657461696e2f70686c69782d7368617265642f67726170682f62616467652e737667)](https://codecov.io/gh/detain/phlix-shared)[![PHP](https://camo.githubusercontent.com/ce1068cd9f78ad2a081449d7e46efb2a2da1ff161c1c5aad703f27366a985ecc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d3737376262343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/)[![PHPStan](https://camo.githubusercontent.com/b72adb1f27170ecf486459c4b07e920bb3db2b464444bce8277e018270665646/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e)](https://phpstan.org/)[![Psalm](https://camo.githubusercontent.com/bda1417d07f86745831148171d1a209a7101d6b6de5283b398fcddb73cb21cd4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5073616c6d2d6c6576656c253230312d627269676874677265656e)](https://psalm.dev/)[![Code style](https://camo.githubusercontent.com/95a767fbd3a1cb06f66fbf4a1298de6d009ce02706a5aed73960e9fc8432f258/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d5053522d2d31322d626c756576696f6c6574)](https://www.php-fig.org/psr/psr-12/)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Shared interfaces, DTOs, event names, and protocol types used by both [`detain/phlix-server`](https://github.com/detain/phlix-server) (the media server) and [`detain/phlix-hub`](https://github.com/detain/phlix-hub) (the multi-server hub). Composer-installable, PHP 8.3+, zero I/O — pure interfaces and value objects only.

Status
------

[](#status)

**v0.8.0 — adds the `library-query` and `media-item` JSON Schemas for the movie-list browse API.** Cumulative surface:

- `Phlix\Shared\Plugin\{LifecycleInterface, Manifest, ManifestType, ManifestValidationError, EventNameMap}`
- `Phlix\Shared\Events\{AbstractEvent, Playback\*, Library\*, Auth\*}` — 12 event DTOs.
- `Phlix\Shared\Auth\{JwtClaims, ProviderInterface, AuthResult, UserInfo}`
- `Phlix\Shared\Hub\{ClaimRequest, ClaimResponse, ServerInfoDto, HeartbeatDto}`
- `Phlix\Shared\Relay\{RelayFrameType, RelayWireCodec, RelayFrame}` — channel-mux protocol (0.5+).
- `Phlix\Shared\Arr\{BazarrClient, ProwlarrClient, RadarrClient, SonarrClient}` — \*arr HTTP clients.
- `Phlix\Shared\Schema\SchemaPaths` — pure path resolver for the bundled `schemas/` files (0.7.0+).

### Bundled schemas

[](#bundled-schemas)

The package ships the canonical JSON files used by both phlix-server and the admin SPA under `schemas/` (resolve their absolute paths via `Phlix\Shared\Schema\SchemaPaths`):

- `schemas/manifest.schema.json` — JSON Schema (draft 2020-12) for plugin manifests, loaded at runtime by `phlix-server`'s `Phlix\Plugins\Manifest\ManifestSchema` validator (0.6.0+).
- `schemas/server-settings.schema.json` — JSON Schema (draft 2020-12) for the editable server settings (`/api/v1/admin/settings`); mirrors phlix-server's `AdminSettingsController::ALLOWED_KEYS` allow-list and drives the admin SPA settings form (0.7.0+).
- `schemas/webhook-events.json` — data catalog of the supported webhook event types for the admin SPA webhook picker. Distinct from the plugin PSR-14 events in `EventNameMap` (0.7.0+).
- `schemas/library-query.schema.json` — JSON Schema (draft 2020-12) for the query parameters of the movie-list browse API (`GET /api/v1/media`); drives `ItemRepository::query()` and the admin SPA browse page (0.8.0+).
- `schemas/media-item.schema.json` — JSON Schema (draft 2020-12) for a single media item returned by the browse API; flattens `metadata_json` into stable top-level fields and always includes `poster_url` (0.8.0+).

The PSR-14 dispatcher wiring (Tukio) and the schema validators stay in `phlix-server` and consume this package via Composer.

Requirements
------------

[](#requirements)

- PHP `^8.3`
- Composer 2.x
- `psr/container ^2.0`
- `psr/event-dispatcher ^1.0`

The package has zero framework dependencies — no Workerman, no Monolog, no Smarty. It is intended to be safely required by any PHP 8.3+ codebase.

Installation
------------

[](#installation)

Until `detain/phlix-shared` is published to Packagist (planned post-v1.0), consumers require it via a Composer VCS repository entry. Use the HTTPS URL so CI runners without SSH keys can resolve it:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/detain/phlix-shared.git"
        }
    ],
    "require": {
        "detain/phlix-shared": "^0.6"
    }
}
```

Then:

```
composer update detain/phlix-shared
```

Related repositories
--------------------

[](#related-repositories)

- [`detain/phlix-server`](https://github.com/detain/phlix-server) — the Phlix media server (consumes this package).
- [`detain/phlix-hub`](https://github.com/detain/phlix-hub) — the multi-server hub + reverse-tunnel relay.

Development
-----------

[](#development)

```
composer install
./vendor/bin/phpunit
./vendor/bin/phpstan analyze --no-progress
./vendor/bin/phpcs --standard=PSR12 src/
./vendor/bin/psalm --no-progress
composer validate --strict
composer audit --no-dev
```

License
-------

[](#license)

MIT — see [`LICENSE`](LICENSE).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance98

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

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

Total

8

Last Release

13d ago

### Community

Maintainers

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

---

Top Contributors

[![detain](https://avatars.githubusercontent.com/u/1364504?v=4)](https://github.com/detain "detain (25 commits)")

---

Tags

composer-packagedtoevent-dispatcherinterfacesjwtlibrarymedia-serveroauth2oidcphpphp8plugin-apipsr-11psr-14psr-7sdkshared-librarystrict-typestyped-php

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/detain-phlex-shared/health.svg)

```
[![Health](https://phpackages.com/badges/detain-phlex-shared/health.svg)](https://phpackages.com/packages/detain-phlex-shared)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

1237.8M117](/packages/web-auth-webauthn-lib)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M395](/packages/drupal-core-recommended)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51090.8k2](/packages/web-auth-webauthn-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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