Giter Site home page Giter Site logo

cookieguard's Introduction

Cookieguard

Handle third party services in compliance with the GDPR

npm license npm

Installation

The library can be installed via NPM. Cookieguard does not offer precompiled or bundled versions, so we recommend using a module bundler like webpack or browserify.

npm i cookieguard

Quick start

Cookieguard consists of JavaScript modules, the main Cookieguard, and several ServiceProvider that enable or disable the dedicated service.

Cookieguard ships with a handful of integrations for the most common services. You may provide the requiered configurations to a Service instance and register this services with Cookieguard. Now we already have a fully configured cookieguard instance.

For more detailed informations see the full documentation.

import Cookieguard, { GoogleAnalytics } from 'cookieguard';

const cookieguard = new Cookieguard({
  ga: new GoogleAnalytics('UA-0000000-1')
});

By default, all registerted services are disabled. You can enable services by passing an array of services to the update method.

cookieguard.update(['ga']);

Note: This configuration is also stored in the browsers localeStorage and next time cookieguard will automatically enable these services.

You may check if valid configurations are stored by using the "isExpired" helper method.

if(cookieguard.isExpired()) {
  // Show the form to select the services.
  ...
  // Opt-in to the users selected services.
  cookieguard.update(selection)
}

License

Cookieguard is open-sourced software licensed under the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.