JSPM

fixed-stub-iabtcf

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q24856F
  • License Apache-2.0

CMP API Stub code fixed for iframe.

Package Exports

  • fixed-stub-iabtcf

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fixed-stub-iabtcf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@iabtcf/stub

Fixed Cmp API Stub code (for iframe purposes).

Generation of lib file

terser src/stub.js --ecma 5 -m -c -o lib/stub.js

Installation

npm

npm install fixed-iabtcf-stub

Using

include via module loading
import * as cmpstub from 'fixed-iabtcf-stub/stub';

or

const cmpstub = require('fixed-iabtcf-stub/stub');

then execute:

cmpstub();

this should generate the __tcfapi() window function with the queing functionality.

to drop on a page
git clone https://github.com/InteractiveAdvertisingBureau/iabtcf-es.git

cd iabtcf-es/modules/stub/

yarn // or npm install

yarn build // or npm run build

Built stub will be output to ./lib

Getting queue of commands
const queue = __tcfapi();
console.log(queue); // [ ['command', 2, callback], ...]