npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@schibstedspain/boros-cmp

v1.5.0

Published

Schibsted GDPR - Consent Management Provider - Standalone

Downloads

65

Readme

Boros CMP

Build status codecov GitHub license npm version

Table of Contents

About

Boros CMP is a stand alone Consent Management Provider solution compliant with the "Transparency & Consent Framework" standard established by the IAB Europe.

Boros CMP is registered with ID 129

Features

  • Open Source project
  • Supports the IAB specification
  • Supports consent management for a single site or multiple sites from a single brand
  • Stand alone project (without User Interface). We also developed a User Interface and a bundle project including UI + CMP
  • Have a look at our CMP Showcase and try Boros

Technical features

  • Importable as a library from NPM.
  • Developed in Javascript (ECMAScript 6) using Promises and Events
  • We :heart: Domain Driven Design
  • Supports local storage using single site cookie
  • Supports global storage using multi site cookie via iFrames

Usage

Boros CMP is available as npm package named @schibstedspain/boros-cmp.

To install the last stable version:

npm install --save @schibstedspain/boros-cmp

To initialize Boros CMP using default configuration values:

import boroscmp from '@schibstedspain/boros-cmp'

boroscmp.init()
    .then(()=>{
        // do your stuff ...
    })

To initialize Boros CMP using customized configuration values:

import boroscmp from '@schibstedspain/boros-cmp'

const customConfig = {
  gdpr: {
    gdprApplies: true,
    storeConsentGlobally: false
  },
  consent: {
    consentScreen: 1,
    consentLanguage: 'es'
  }
}

boroscmp.init({config: customConfig})
    .then(()=>{
        // do your stuff ...
    })

Notice that init method is returning a Promise but you can subscribe to cmpReady event instead:

import boroscmp from '@schibstedspain/boros-cmp'

window.document.addEventListener("cmpReady", (event) => {
  // do your stuff ...
  // like calling window.__cmp( ...
})

boroscmp.init()

You could also import directly the library instead the bundled version. By using this, it will assume you're providing the @babel/runtime dependency, helpers and polyfills needed to get it working but it will give you a better size by reusing your packages.

import boroscmp from '@schibstedspain/boros-cmp/lib'

boroscmp.init()
  .then(()=>{
    // do your stuff ...
  })

Initialize Boros cmp global version

Boros should be initialized with at least this custom configuration

import boroscmp from '@schibstedspain/boros-cmp'

const customConfig = {
  gdpr: {
    storeConsentGlobally: true,
    globalConsentLocation: 'http://local.schibsted.io:8000/index.html'
  }
}

boroscmp.init({config: customConfig})
    .then(()=>{
        // do your stuff ...
    })

In the globalConsentLocation provided, a server should be running and it should have the boros script builded for global version on it (global.dev.js or global.pro.js).

Configuration

There are some default configuration values that can be overwritten before CMP is loaded. Following you will find all the configuration properties and their default values.

Configuration Properties and default Values

|Property|Description|Default Value| |---|---|---| |gdpr.gdprApplies|Defines if GDPR applies or not.|true| |gdpr.storeConsentGlobally|Defines if Consent Storage is Global (true) or Local (false).|false| |gdpr.globalConsentLocation|The source URL of global storage html.|| |consent.consentScreen|Screen number where consent was given.|1| |consent.consentLanguage|Defines the language for the UI.|es| |vendorList.host|Host URL to retrieve Vendor lists.|https://vendorlist.consensu.org| |log.level|Defines the Log level.|3|

gdpr.gdprApplies

Defines if GDPR applies or not.

gdpr.storeConsentGlobally

Defines if Consent Storage is Global (true) or Local (false).

gdpr.globalConsentLocation

The source URL of global storage html.

consent.consentScreen

Defines the Screen number in the CMP where consent was given. The screen number is CMP and CmpVersion specific, and is for logging proof of consent

consent.consentLanguage

This language will be used by the User interface using CMP. Language values are ISO 639-1 (2 letter codes). By default, es will be used.

Check the available translations here: https://register.consensu.org/Translation

vendorList.host

To find Vendor lists, CMP tries to retrieve a JSON named vendorlist.json and uses the IAB version structure, as follows:

  • Latest Vendor list: https://vendorlist.consensu.org/vendorlist.json
  • Specific Vendor list version: https://vendorlist.consensu.org/v-${vendorListVersion}/vendorlist.json
    • where ${vendorListVersion} is the specific version to retrieve. For example: https://vendorlist.consensu.org/v-2/vendorlist.json

log.level

Available log level values:

|Code|Level| |---|---| |1|debug| |2|info| |3|warn| |4|error| |5|off|

CMP version

CMP version is set according to the version defined inside the package.json file. IAB standard uses only one number to define this version, so only the major version (first digit) will be used.

License

CMP is MIT licensed.