Socket
Socket
Sign inDemoInstall

cookieguard

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cookieguard

Handle third party services in compliance with the GDPR


Version published
Weekly downloads
10
increased by900%
Maintainers
1
Install size
12.5 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 18 Sep 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc