@adv-ui/boros-tcf-stub

1.2.0 • Public • Published

Boros TCF Stub

Build status codecov GitHub license npm version

Table of Contents

About

The Boros TCF stub implements the standard TCF v2 stub

Features

  • Registers the __tcfapiLocator frame

  • Stubs the window.__tcfapi responding immediately to the commands

  • Initializes the cross-framee communication via postMessagee, see usage details

Usage

As an importable module

Use it this way if you're generating your own initialization

Install

npm i @adv-ui/boros-tcf-stub --save

Register the Stub

import registerStub from '../main'

// do your magic
registerStub()

Register the Stub with an onReady callback

This allows creating additional commands that can have access to the Boros TCF API facade.

import registerStub from '../main'

const onReady = api => initializeCustomCommands(api)
 
registerStub({onReady})

The onReady callback will be called after Boros TCF initializes the window.__tcfapi and before processing any pending command in the stub's queue.

Remember that the Stub must be registered before any script depending on the TCF is loaded

As a standalone script

Add it to the head tag

<script
  src="https://c.dcdn.es/borostcf/stub/BorosTcfStub.pro.js"
  async="false" 
/>

This does not accept registering an onReady callback. Import the registerStub and generate your own script if it's a need.

License

Boros TCF Stub is MIT licensed.

Package Sidebar

Install

npm i @adv-ui/boros-tcf-stub

Weekly Downloads

6

Version

1.2.0

License

MIT

Unpacked Size

12.8 kB

Total Files

11

Last publish

Collaborators

  • andresin87.adevinta
  • joanleon-adv
  • izeller
  • luard-adv
  • serena.mejias
  • ignacio_navarro
  • jordi.munoz
  • oscar_ramirez
  • luis-garrido
  • ivanmlaborda
  • a.ferrer
  • jenifer.lopez
  • alejandro.ferrante
  • alfredo.arronte
  • francisco.ruiz.lloret
  • arnau.guell
  • jamile.radloff
  • schibstedspain
  • davidmartin2108
  • izaskunpena
  • oscar-raig-adevinta
  • ferran.simon
  • mariapaula.forero.ext
  • carlos.gonzalezl
  • oriol.puig
  • david.nieto
  • nacho_torrella
  • xavi.murcia
  • sabri-castelli
  • pablogs
  • ignacio.rodriguez
  • isabelgomez87
  • oriol.hilari
  • hpintos_adevinta
  • javiauso
  • azahara
  • alisa_bayanova
  • cristhianb
  • sergiocollado
  • pablo.rey-adevinta
  • beatrizip
  • alex.castells
  • tomasadevinta
  • marc.benito
  • sergio.escano
  • arturo.vicente
  • lolaruf
  • pol.valls
  • frandelacasa-adevinta
  • andresadv
  • estefania_garcia
  • victor.perez.adevinta
  • thomas.page.ext
  • sebastian.badea.adevinta
  • luz_adv
  • sendami.luque.ext
  • oscar.gomez
  • alfredo.narvaez
  • ruben-martin
  • emiliovz
  • dann41
  • sergi.martinez.adevinta
  • guillemgc3
  • adevinta-motor-frontend
  • frontend-jobs
  • adv-re-bot
  • javiermiguel
  • eric-darbra
  • alverd004
  • atilioscolaroadv
  • crotundu.adevinta
  • candymd
  • florinz
  • denis_z
  • stivali.serna
  • anya_ok
  • nhowleyad
  • rmg-adevinta
  • manuel.ochoa
  • nicolas.gonzalez.ext
  • adria.velardos
  • jorge_castro_adevinta_npm_motor
  • zecafernandez
  • aitor.rodriguez
  • rusabe