Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@transferwise/cookie-consent
Advanced tools
![npm](https://img.shields.io/npm/v/@transferwise/cookie-consent)
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
![npm](https://img.shields.io/npm/v/@transferwise/cookie-consent)
We found that @transferwise/cookie-consent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.