# @iabtcf/stub

> CMP API Stub code

Latest version **1.5.6** (published 2023-04-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @iabtcf/stub
pnpm add @iabtcf/stub
yarn add @iabtcf/stub
bun add @iabtcf/stub
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.5.6 |
| Published | 2023-04-04 |
| First published | 2020-01-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 153 |
| Author | Chris Paterson |
| Maintainers | chrispaterson, shortaflip |
| Keywords | interactive, advertising, bureau, iab, transparency, consent, consentstring, tcstring, gvl, vendor, framework, tcf, lib, library, cmp, 2.0, v2.0, v2, software, development, api, kit, sdk, gdpr |

## Links

- npm: https://www.npmjs.com/package/@iabtcf/stub
- Repository: https://github.com/InteractiveAdvertisingBureau/iabtcf-es
- Homepage: https://iabtcf.com/
- npm.io page: https://npm.io/package/@iabtcf/stub

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.5.6 (latest) — 2023-04-04
- 1.5.6-1 — 2023-03-20
- 1.5.6-0 — 2022-12-02
- 1.5.5 — 2022-11-15
- 1.5.4-0 — 2022-10-28
- 1.5.3 — 2022-07-12
- 1.5.0-3 — 2022-06-15
- 1.5.0-2 — 2022-05-23
- 1.5.0-0 — 2022-05-04
- 1.4.0 — 2022-01-31
- 1.4.0-0 — 2022-01-14
- 1.3.1 — 2021-09-22
- 1.3.1-0 — 2021-09-07
- 1.3.0 — 2021-07-21
- 1.3.0-2 — 2021-07-08
- … 65 more at https://npm.io/package/@iabtcf/stub/versions

## README

[![NPM version](https://img.shields.io/npm/v/@iabtcf/stub.svg?style=flat-square)](https://www.npmjs.com/package/@iabtcf/stub)
[![npm module downloads per month](http://img.shields.io/npm/dm/@iabtcf/stub.svg?style=flat)](https://www.npmjs.org/package/@iabtcf/stub)
[![InteractiveAdvertisingBureau](https://circleci.com/gh/InteractiveAdvertisingBureau/iabtcf-es.svg?style=shield)](https://circleci.com/gh/InteractiveAdvertisingBureau/iabtcf-es)

# @iabtcf/stub

Cmp API Stub code.  Maybe included in commonjs loader or dropped directly on the page.

#### Installation

npm
```
npm install @iabtcf/stub
```

yarn
```
yarn add @iabtcf/stub
```
#### Using

##### include via module loading
```javascript
import * as cmpstub from '@iabtcf/stub';
```
or

```javascript
const cmpstub = require('@iabtcf/stub');
```

then execute:

```javascript
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

```javascript
const queue = __tcfapi();
console.log(queue); // [ ['command', 2, callback], ...]
```

---
_Source: https://npm.io/package/@iabtcf/stub · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
