Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@financial-times/ads-permutive

Package Overview
Dependencies
Maintainers
18
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/ads-permutive - npm Package Compare versions

Comparing version 4.0.0-beta.11 to 4.0.0-beta.12

35

dist/ads-permutive.cjs.js

@@ -5,24 +5,2 @@ 'use strict';

/**
* Get consent based on FTConsent cookie
* TODO Consents can be derived outside of the package and passed in as config/context
*/
const hasConsentedToBehaviouralAds = () => {
// derive consent options from ft consent cookie
const consentValue = getCookieValue('FTConsent');
return consentValue && consentValue.includes('behaviouraladsOnsite:on');
};
const getCookieValue = cookieKey => {
const re = new RegExp(`${cookieKey}=([^;]+)`);
const match = document.cookie.match(re);
if (!match) {
// cookie stasis or no cookie found
return false;
}
return decodeURIComponent(match[1]);
};
var env = {

@@ -146,3 +124,3 @@ PERMUTIVE_PUBLIC_API_KEY: 'b2b3b748-e1f6-4bd5-b2f2-26debc8075a3',

const loadPermutiveScript = () => hasConsentedToBehaviouralAds() && loadScript(PERMUTIVE_SCRIPT_URI(env.PERMUTIVE_PUBLIC_ID), {
const loadPermutiveScript = () => loadScript(PERMUTIVE_SCRIPT_URI(env.PERMUTIVE_PUBLIC_ID), {
scriptId: "permutive-script"

@@ -682,6 +660,3 @@ });

const publicApiKey = env.PERMUTIVE_PUBLIC_API_KEY;
if (hasConsentedToBehaviouralAds()) {
bootstrap(publicId, publicApiKey, filterConfigOptions(configOptions));
}
bootstrap(publicId, publicApiKey, filterConfigOptions(configOptions));
};

@@ -751,6 +726,3 @@ /**

if (hasConsentedToBehaviouralAds()) {
console.warn("ads-permutive.isInitialised(): window.permutive not initialised. " + "Perhaps setup() has not been executed yet?");
}
console.warn("ads-permutive.isInitialised(): window.permutive not initialised. " + "Perhaps setup() has not been executed yet?");
return false;

@@ -792,3 +764,2 @@ };

fromAdsDataToPageView,
hasConsentedToBehaviouralAds,
loadPermutiveScript,

@@ -795,0 +766,0 @@ isInitialised

@@ -1,23 +0,1 @@

/**
* Get consent based on FTConsent cookie
* TODO Consents can be derived outside of the package and passed in as config/context
*/
const hasConsentedToBehaviouralAds = () => {
// derive consent options from ft consent cookie
const consentValue = getCookieValue('FTConsent');
return consentValue && consentValue.includes('behaviouraladsOnsite:on');
};
const getCookieValue = cookieKey => {
const re = new RegExp(`${cookieKey}=([^;]+)`);
const match = document.cookie.match(re);
if (!match) {
// cookie stasis or no cookie found
return false;
}
return decodeURIComponent(match[1]);
};
var env = {

@@ -141,3 +119,3 @@ PERMUTIVE_PUBLIC_API_KEY: 'b2b3b748-e1f6-4bd5-b2f2-26debc8075a3',

const loadPermutiveScript = () => hasConsentedToBehaviouralAds() && loadScript(PERMUTIVE_SCRIPT_URI(env.PERMUTIVE_PUBLIC_ID), {
const loadPermutiveScript = () => loadScript(PERMUTIVE_SCRIPT_URI(env.PERMUTIVE_PUBLIC_ID), {
scriptId: "permutive-script"

@@ -677,6 +655,3 @@ });

const publicApiKey = env.PERMUTIVE_PUBLIC_API_KEY;
if (hasConsentedToBehaviouralAds()) {
bootstrap(publicId, publicApiKey, filterConfigOptions(configOptions));
}
bootstrap(publicId, publicApiKey, filterConfigOptions(configOptions));
};

@@ -746,6 +721,3 @@ /**

if (hasConsentedToBehaviouralAds()) {
console.warn("ads-permutive.isInitialised(): window.permutive not initialised. " + "Perhaps setup() has not been executed yet?");
}
console.warn("ads-permutive.isInitialised(): window.permutive not initialised. " + "Perhaps setup() has not been executed yet?");
return false;

@@ -787,3 +759,2 @@ };

fromAdsDataToPageView,
hasConsentedToBehaviouralAds,
loadPermutiveScript,

@@ -790,0 +761,0 @@ isInitialised

7

package.json
{
"name": "@financial-times/ads-permutive",
"version": "4.0.0-beta.11",
"version": "4.0.0-beta.12",
"description": "A library for bringing permutive to FT.com apps",

@@ -25,5 +25,2 @@ "keywords": [],

"@babel/preset-env": "7.15.8",
"@rollup/plugin-babel": "5.3.0",
"@rollup/plugin-commonjs": "21.0.0",
"@rollup/plugin-node-resolve": "13.0.5",
"jest": "27.2.5",

@@ -37,2 +34,2 @@ "rollup": "2.58.0"

}
}
}

@@ -72,10 +72,2 @@ ads-permutive

### adsPermutive.hasConsentedToBehaviouralAds()
It checks if the user has consented to behavioural Ads, by looking up in the `FTConsent` Cookie for `behaviouraladsOnsite` to be on.
*Example:*
```javascript
adsPermutive.hasConsentedToBehaviouralAds()
```
### adsPermutive.identifyUser(userIdentity)

@@ -82,0 +74,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc