Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@protodigital/cookie-controller
Advanced tools
Readme
The Proto Cookie Controller is a lightweight JavaScript library that enables you to easily implement a cookie consent solution on your website. It offers a range of features that enable you to support GDPR compliance.
Similar to other Proto libraries, there is a focus of config in HTML and the library avoids inserting any HTML into the DOM and requires no CSS. This means you can easily customise the look and feel of the cookie controller to match your website's design.
data-cookie-action="save"
attribute - if not present, cookie prefferences will be saved on checkbox change.To install the Proto Cookie Controller library, run the following command:
npm install @protodigital/cookie-controller
To use the Proto Cookie Controller library, import the CookieController
class from the library and instantiate.
import CookieController from "@protodigital/cookie-controller";
new CookieController({
onConsentChange: (data) => {
console.log(data);
},
versioning: {
current: "1.0.0",
onNewVersion: (oldVersion, newVersion) => {
console.log(oldVersion, newVersion);
},
},
});
All config is optional, though you will need to supply a onConsentChange callback and save the data to ensure compliance with the consent recording requirements of GDPR.
<div data-cookie-details>
<button data-cookie-action="dismiss">Close</button>
<button data-cookie-action="accept">Accept Recommended</button>
<button data-cookie-action="reject">Reject</button>
<a href="https://www.example.com/privacy-policy" target="_blank">
Cookie Policy
</a>
<ul>
<li>
<input id="analytics" type="checkbox" data-cookie-config="analytics" />
<label for="analytics">Analytics</label>
</li>
<li>
<input id="marketing" type="checkbox" data-cookie-config="marketing" />
<label for="marketing">Marketing</label>
</li>
</ul>
<!-- If not present, cookie prefferences will be saved on checkbox change -->
<button data-cookie-action="save">Save My Preferences</button>
</div>
<div data-cookie-alert>
<button data-cookie-action="accept">Accept All</button>
<button data-cookie-action="reject">Reject</button>
<button data-cookie-action="details">Details</button>
<button data-cookie-action="dismiss">Close</button>
</div>
<button data-cookie-action="details">Open Cookie Modal</button>
For a more detailed example, checkout the tailwind.html example.
destroy()
Destroy the cookie controller instance and remove all event listeners. Useful for using within SPA's.
getCookieConsent(key)
Returns the current consent status of a cookie key (true/false).
Our cookie controller is developed with GDPR considerations in mind, supporting adherence to GDPR principles. While this tool offers functionalities aligning with GDPR requirements, full compliance depends on how it is implemented within your website's broader context and architecture.
Here are some tips for achieving compliance:
data-cookie-config
attribute, as they are for informational purposes only.Please note this is not an exhaustive list, and we recommend seeking legal advice to ensure full compliance.
FAQs
A lightweight cookie consent solution to help you comply with the EU Cookie Law and GDPR.
The npm package @protodigital/cookie-controller receives a total of 0 weekly downloads. As such, @protodigital/cookie-controller popularity was classified as not popular.
We found that @protodigital/cookie-controller demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.