syntro/silverstripe-klaro

Silverstripe module including klaro consent

Installs: 2 538

Dependents: 2

Suggesters: 0

Security: 0

Stars: 3

Watchers: 4

Forks: 0

Open Issues: 4

Type:silverstripe-vendormodule

1.4.0 2023-06-28 11:23 UTC

README

🎭 Tests codecov Dependabot phpstan composer Packagist Version

Silverstripe module for implementing a GDPR compliant service notice on a silverstripe based website.

Introduction

from the klaro website:

Klaro is a simple and powerful open source consent management platform (CMP) that helps you to meet the requirements of the GDPR and to protect the privacy of your website visitors and users.

Simply put, klaro is an easy to use and easy to set up tool for GDPR compliant cookie and service management. As Silverstripe does not provide such a mechanism out of the box, klaro can help fill in the gap for sites and applications aimed at european audiences.

While there are some modules around which allow the integration of klaro in a silverstripe based project, most of them use a database-centered approach for managing cookies and services. At Syntro, we believe that this approach, while flexible, does not do justice to the complexity of the subject matter and, because of the editability (and especially removability) of services by the end user, can be dangerous. For this reason, we introduced our own module.

syntro/silverstripe-klaro uses the silverstripe configuration api and the silverstripe requirements pattern to manage services in an easy to learn way while giving the end user some control about texts displayed in the notice and modal.

Give it a try, Feedback is always welcome!

Installation

To install this module, run the following command:

composer require syntro/silverstripe-klaro

Usage

Quick Start

If you just want to add a new service, add the script like so:

use Syntro\SilverstripeKlaro\KlaroRequirements;

// ...

KlaroRequirements::klaroJavascript('path/to/file.js', 'myservice');

In order to add this service to the notice, create a config like so:

Syntro\SilverstripeKlaro\Config:
    klaro_purposes:
        mypurpose:
            title: My Purpose
            description: This is my purpose
    klaro_services:
        myservice:
            title: My Service
            purposes: [ 'mypurpose' ]

After flushing, the modal will display myservice and the script will only be active if accepted by the user.

Docs

Please read the documentation for further information about how to customise klaro:

  1. Service management
  2. Translations
  3. Styling

Contributing

See CONTRIBUTION.md for mor info.