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

ActiveSymfony-bundle

apirelio/symfony
================

Fail-safe Symfony SDK for Apirelio customer integration analytics.

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

Since Jul 29Pushed todayCompare

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

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

Apirelio Symfony SDK
====================

[](#apirelio-symfony-sdk)

Fail-safe customer integration analytics for Symfony APIs. The bundle records normalized endpoint metrics and customer context without capturing request or response bodies, credentials, cookies, query strings, IP addresses, or personal data. The shared event contract, privacy rules and delivery primitives come from `apirelio/php-core`, installed automatically by Composer.

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

[](#requirements)

- PHP 8.2, 8.3 or 8.4
- Symfony 6.4, 7.4 or 8.x

Symfony 8 itself requires PHP 8.4. Symfony 6.4 and 7.4 can be used on PHP 8.2.

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

[](#installation)

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

Register the bundle:

```
// config/bundles.php
return [
    // ...
    Apirelio\Symfony\ApirelioBundle::class => ['all' => true],
];
```

Configure the project key shown once in the Apirelio dashboard:

```
APIRELIO_ENABLED=true
APIRELIO_ENDPOINT=https://api.apirelio.com
APIRELIO_API_KEY=apr_live_xxxxxxxxx
APIRELIO_SERVICE=billing-api
APIRELIO_ENVIRONMENT=production
APIRELIO_RELEASE=2026.07.29.1
```

```
# config/packages/apirelio.yaml
apirelio:
    enabled: '%env(bool:APIRELIO_ENABLED)%'
    endpoint: '%env(APIRELIO_ENDPOINT)%'
    api_key: '%env(APIRELIO_API_KEY)%'
    service: '%env(APIRELIO_SERVICE)%'
    environment: '%env(APIRELIO_ENVIRONMENT)%'
    release: '%env(APIRELIO_RELEASE)%'
    transport: messenger
    paths:
        - /api/*
```

The subscriber is registered automatically and records matching main requests. Route templates are used instead of concrete URLs, so `/api/invoices/123`becomes `/api/invoices/{invoice}` and query strings are never sent.

Messenger transport
-------------------

[](#messenger-transport)

The default `messenger` transport moves network delivery outside the customer request. Route the SDK message to an asynchronous transport:

```
# config/packages/messenger.yaml
framework:
    messenger:
        routing:
            'Apirelio\Symfony\Message\BufferApirelioEvents': async
```

Run your normal Messenger worker:

```
php bin/console messenger:consume async
```

Failed ingestion requests throw inside the worker so Symfony Messenger can apply its configured retry and failure transport policies.

Customer and application identity
---------------------------------

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

Create application-specific resolvers:

```
