PHPackages                             apirelio/flightphp - 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. apirelio/flightphp

ActiveLibrary

apirelio/flightphp
==================

Fail-safe FlightPHP middleware for Apirelio customer integration analytics.

v1.0.0(today)02↑2900%MITPHPPHP ^8.2CI passing

Since Aug 28Pushed todayCompare

[ Source](https://github.com/pryznar/apirelio-flightphp)[ Packagist](https://packagist.org/packages/apirelio/flightphp)[ RSS](/packages/apirelio-flightphp/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Apirelio FlightPHP SDK
======================

[](#apirelio-flightphp-sdk)

[Documentation](https://apirelio.com/docs/php/flightphp) · [Live demo](https://apirelio.com/demo?framework=flightphp) · [Packagist](https://packagist.org/packages/apirelio/flightphp) · [Apirelio](https://apirelio.com)

[![Packagist Version](https://camo.githubusercontent.com/0f70ba3344a011196f97b92ebb0433be474aa37450b66e25729ef5e10ab2bba8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61706972656c696f2f666c696768747068702e737667)](https://packagist.org/packages/apirelio/flightphp)[![Tests](https://github.com/pryznar/apirelio-flightphp/actions/workflows/tests.yml/badge.svg)](https://github.com/pryznar/apirelio-flightphp/actions/workflows/tests.yml)

Customer-aware API monitoring middleware for FlightPHP 3. It captures route-level operational telemetry without request or response payloads and delegates the shared event contract, privacy filtering and delivery to `apirelio/php-core`.

[![Apirelio customer-level API dashboard](https://raw.githubusercontent.com/pryznar/apirelio-app/main/apps/frontend/public/img/apirelio-live-demo-dashboard.jpg)](https://apirelio.com/demo?framework=flightphp)

**[See the live customer-impact demo →](https://apirelio.com/demo?framework=flightphp)**

Install in 30 seconds
---------------------

[](#install-in-30-seconds)

```
composer require apirelio/flightphp:^1.0
```

```
use Apirelio\FlightPHP\ApirelioMiddleware;
use Apirelio\FlightPHP\Config as ApirelioConfig;
use flight\Engine;

$app = new Engine;
$apirelio = new ApirelioMiddleware($app, new ApirelioConfig(
    apiKey: (string) getenv('APIRELIO_API_KEY'),
    service: 'billing-api',
    environment: getenv('APP_ENV') ?: 'production',
    release: getenv('APP_RELEASE') ?: null,
    paths: ['/api/*'],
    bufferPath: __DIR__.'/../storage/apirelio-events.ndjson',
));

$app->group('/api', function () use ($app): void {
    $app->get('/invoices/@id', [InvoiceController::class, 'show'], false, 'invoices:view');
}, [$apirelio]);

$app->start();
```

Flight executes `before()` before the route and `after()` afterwards. Apirelio reads the matched `Route::$pattern` and alias from `Router::$executedRoute`; an internal `flight.error` listener records the exception class when the route fails.

Identify the customer
---------------------

[](#identify-the-customer)

```
use Apirelio\Core\Data\ApirelioApplication;
use Apirelio\Core\Data\ApirelioCustomer;

$apirelio = new ApirelioMiddleware(
    app: $app,
    config: $config,
    customerResolver: static function (Engine $app, array $params): ?ApirelioCustomer {
        $account = $app->account();

        return $account === null ? null : new ApirelioCustomer(
            id: (string) $account->id,
            name: $account->name,
            plan: $account->plan,
        );
    },
    applicationResolver: static fn (Engine $app): ApirelioApplication => new ApirelioApplication(
        id: (string) $app->apiClient()->id,
    ),
);
```

Add safe request context
------------------------

[](#add-safe-request-context)

```
$apirelio->context()?->addMetadata(['region' => 'eu-central']);
$apirelio->context()?->setErrorCode('PAYMENT_REQUIRED');
```

Only scalar metadata keys listed in `metadataKeys` are retained. Sensitive-looking keys are always rejected. Request bodies, response bodies, query strings, credentials, cookies, client IPs and exception messages are never captured.

Example application
-------------------

[](#example-application)

The [`example`](example) directory contains a complete FlightPHP API bootstrap. Connect it to a project and then open the [live Apirelio demo](https://apirelio.com/demo?framework=flightphp) to see the resulting customer-level workflow.

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

[](#requirements)

- PHP 8.2+
- FlightPHP 3.10+
- ext-curl and ext-mbstring

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Total

2

Last Release

0d ago

Major Versions

v0.1.0 → v1.0.02026-08-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/461b0a594590cb170c4544f10538e6fef5a98320c4f584188fc1a34c10143545?d=identicon)[pryznar](/maintainers/pryznar)

---

Top Contributors

[![pryznar](https://avatars.githubusercontent.com/u/3277536?v=4)](https://github.com/pryznar "pryznar (1 commits)")

---

Tags

api-monitoringcustomer-analyticsflightphpmiddlewareobservabilityphpobservabilityflightphpAPI monitoringcustomer-analytics

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/apirelio-flightphp/health.svg)

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

###  Alternatives

[treblle/treblle-laravel

Runtime Intelligence Platform

135234.2k](/packages/treblle-treblle-laravel)[inspector-apm/inspector-php

Inspector monitoring for PHP applications.

353.2M34](/packages/inspector-apm-inspector-php)[grafana/foundation-sdk

A set of tools, types and libraries for building and manipulating Grafana objects.

24850.0k](/packages/grafana-foundation-sdk)[treblle/treblle-php

Runtime Intelligence Platform

2090.5k2](/packages/treblle-treblle-php)

PHPackages © 2026

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