PHPackages                             apirelio/nette - 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/nette

ActiveLibrary

apirelio/nette
==============

Fail-safe Nette SDK for Apirelio customer integration analytics.

v0.2.0(today)00MITPHPPHP ^8.2CI passing

Since Jul 29Pushed todayCompare

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

READMEChangelogDependencies (8)Versions (3)Used By (0)

Apirelio for Nette
==================

[](#apirelio-for-nette)

Fail-safe customer integration analytics for Nette applications. The package uses the shared [`apirelio/php-core`](https://github.com/pryznar/apirelio-php-core) event contract, sanitization, retry and file buffer.

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

[](#requirements)

- PHP 8.2+
- Nette Application 3.2 or 3.3
- ext-curl

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

[](#installation)

```
composer require apirelio/nette:^0.2
```

Register the native DI extension:

```
extensions:
    apirelio: Apirelio\Nette\DI\ApirelioExtension

apirelio:
    apiKey: %env.APIRELIO_API_KEY%
    endpoint: https://api.apirelio.com
    service: billing-api
    environment: production
    release: 2026.07.29.1
    paths:
        - /api/*
    metadataKeys:
        - region
```

The extension automatically records matched Nette application requests through `onRequest`, `onResponse` and `onError`. Delivery failures are swallowed and optionally logged, so analytics cannot change the customer response.

The default `fileBuffer` transport persists events before sending them. Use a writable application temp directory:

```
apirelio:
    transport: fileBuffer
    bufferPath: %tempDir%/apirelio/events.ndjson
    batchSize: 500
    flushIntervalSeconds: 10
```

For direct synchronous delivery:

```
apirelio:
    transport: sync
```

Request context
---------------

[](#request-context)

Inject `Apirelio\Nette\ApirelioManager` into a presenter or service:

```
use Apirelio\Nette\ApirelioManager;

final class InvoiceService
{
    public function __construct(private ApirelioManager $apirelio) {}

    public function create(): void
    {
        $this->apirelio->addMetadata(['region' => 'eu-central']);
        $this->apirelio->setErrorCode('VALIDATION_FAILED');
    }
}
```

Only keys listed in `metadataKeys` are retained. Secrets, request bodies, query parameters, cookies and authorization headers are never collected.

Manual business events
----------------------

[](#manual-business-events)

```
$apirelio->track(
    event: 'invoice.created',
    integration: 'fakturoid',
    metadata: ['region' => 'eu-central'],
);
```

Customer and application resolvers
----------------------------------

[](#customer-and-application-resolvers)

Implement the resolver contracts:

```
use Nette\Application\Request;
use Apirelio\Nette\Contracts\CustomerResolver;
use Apirelio\Nette\Data\ApirelioCustomer;

final class CurrentCustomerResolver implements CustomerResolver
{
    public function resolve(Request $request): ?ApirelioCustomer
    {
        return new ApirelioCustomer('customer_42', 'Acme Europe', 'growth');
    }
}
```

Register the services and reference their service names:

```
services:
    app.customerResolver: App\Analytics\CurrentCustomerResolver
    app.applicationResolver: App\Analytics\CurrentApplicationResolver

apirelio:
    customerResolver: app.customerResolver
    applicationResolver: app.applicationResolver
```

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

[](#development)

```
composer test
composer phpstan
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k17](/packages/tempest-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)

PHPackages © 2026

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