A Symfony bundle that integrates the consent contracts

Installs: 9 431

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 2


v0.1.1 2021-11-08 14:03 UTC


Latest Version Latest Unstable Version Software License Build Status Code Coverage Mutation testing

This bundle integrates the consent contracts into Symfony.


composer require setono/consent-bundle

This installs and enables the plugin automatically if you're using Symfony Flex. If not, add the bundle manually to bundles.php.


The default configuration has all permissions (marketing, preferences, and statistics) set to false. If you want to change these defaults, you can easily do so:

# config/packages/setono_consent.yaml

    marketing_granted: true
    preferences_granted: true
    statistics_granted: true

The above configuration will effectively changes the default consent to true for all permissions.


The bundle provides a default consent context that you can easily inject and use inside your application:

use Setono\Consent\Context\ConsentContextInterface;

final class YourMarketingTrackingService
    private ConsentContextInterface $consentContext;
    public function __construct(ConsentContextInterface $consentContext) {
        $this->consentContext = $consentContext;
    public function track(): void
        if(!$this->consentContext->getConsent()->isMarketingConsentGranted()) {
        // do your marketing tracking