
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@transferwise/cookie-consent
Advanced tools

This repo contains helper functions to make your application compliant with ICO regulations. How to make your application compliant with ICO regulations
yarn add @transferwise/cookie-consent
import { hasValidConsent } from "@transferwise/cookie-consent";
if (hasValidConsent()) {
mixpanel.opt_in_tracking();
}
hasValidConsent()
checks the cookie consent from document.cookie
. If consent
cookie is not there or document
is undefined then it will return false
.
import { cookie } from "@transferwise/cookie-consent";
cookie.write(
"username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/"
);
cookie.write(string, object)
takes 2 arguments:
document.cookie
essential
- if it's
true
then we will add it to document.cookie
even when we don't have
consent
How to know if my cookie is essential?Adding essential cookie
:
import { cookie } from "@transferwise/cookie-consent";
cookie.write(
"username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/",
{ essential: true }
);
yarn test
The package also includes the constants used when creating the consent cookie, and a JSON representation of the cookie policy.
These are typically utilised by the consent mechansim, audit tooling (e.g., cookie monster).
CHANGELOG.md
FAQs
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.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.