Nectar of the Programming Masses

    @freshheads/cookie-guard
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.0 • Public • Published

    FHCookieGuard

    This library provides a cookie notification in which the user can accept or decline the usage of cookies on the website. When accepting it will load guarded scripts in meta tags.

    Features

    • Options for cookie name, expire days, callback etc.
    • Transform data-content attribute to working script tag
    • Exclude cookie message on certain pages
    • Option to auto accept cookies after x requests
    • Ready to use sass styling components for a variation of cookie notifications and popups
    • Ready to use twig example to be used with styling

    Documentation

    Browser support

    This library supports the latest 2 versions of all modern browsers. But support can be extended by converting code to ES5 and using some polyfills.

    • IE11 convert ES2015 code to ES5 with webpack or another bundler Still using ES5 build for now due to import issues in webpack with babel
    • IE10 support by adding element.dataset polyfill

    Roadmap

    • Add cookie groups that can be accepted or refused, eg. Functional / Analitic / Advertorial / Social cookies

    Keywords

    none

    Install

    npm i @freshheads/cookie-guard

    DownloadsWeekly Downloads

    8

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    33.9 kB

    Total Files

    29

    Last publish

    Collaborators

    • tech-freshheads