Cmp API Stub code. Maybe included in commonjs loader or dropped directly on the page.
npm
npm install @iabtcf/stub
yarn
yarn add @iabtcf/stub
import * as cmpstub from '@iabtcf/stub';
or
const cmpstub = require('@iabtcf/stub');
then execute:
cmpstub();
this should generate the __tcfapi()
window function with the queing functionality.
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
const queue = __tcfapi();
console.log(queue); // [ ['command', 2, callback], ...]