Skip to content

brugos/cookie-policy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookie policy message

Show a cookie policy message/banner on your site

Installation

npm install --save tmw-cookiepolicy

Import/require

// ES2015/ES6
import CookiePolicy from 'tmw-cookiepolicy';

// ES5
var CookiePolicy = require('tmw-cookiepolicy');

UMD build

If you need a UMD/ES5 version, it has been provided. Use the CDN version at https://unpkg.com/[email protected]/umd/cookie-policy-umd.js or require it with an explicit path:

var CookiePolicy = require('tmw-cookiepolicy/umd/cookie-policy-umd');

Options

var policyElement = document.querySelector('.cookiePolicy');

new CookiePolicy(policyElement, {
	// options, defaults listed

	policyName: 'policy-agreed',
	// cookie name to check

	policySeen: 'policy-seen',
	// cookie name to check

	expire: 30,
	// in days
});

Template

Use the template at https://github.com/tmwagency/cookie-policy/blob/master/template.html

Styling

Some basic styles for the banner can be found at https://github.com/tmwagency/cookie-policy/blob/master/cookiePolicy.css

About

A cookie policy message/banner on your site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 64.5%
  • HTML 20.6%
  • CSS 14.9%