# oath-viewability

> Oath viewability plugin

Latest version **2.2.0** (published 2019-03-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install oath-viewability
pnpm add oath-viewability
yarn add oath-viewability
bun add oath-viewability
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2019-03-14 |
| First published | 2017-10-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 51.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | o2_ad_client |

## Links

- npm: https://www.npmjs.com/package/oath-viewability
- npm.io page: https://npm.io/package/oath-viewability

## Recent versions

- 2.2.0 (latest) — 2019-03-14
- 2.1.0 — 2019-03-14
- 2.0.0 — 2018-03-13
- 1.0.1 — 2017-10-25
- 1.0.0 — 2017-10-10

## README

# oath-viewability

Oath viewability detection plugin

## Screwdriver Pipeline
https://screwdriver.ouroath.com/pipelines/1008183/events

## Install
```
npm install --save oath-viewability
```

## Usage

### ECMA6+ style

```es
import oathViewabilityLoader from 'oath-viewability'

const someDOMElement = document.getElementById('my-element')
oathViewabilityLoader.then((oathViewability) => {
    const elementViewability = new oathViewability(someDOMElement)
    elementViewability.then((detector) => {
        detector.getPercent() // {0-100}
        detector.getVisible() // {0|1}
    })    
})

```

### Common JS Style

Embed the script from `./node_modules/oath-viewability/dist/clj.js`

```js
(function(window) {
    var someDOMElement = document.getElementById('my-element');
    
    window.oath.viewability.then(function(oathViewability) {
        var elementViewability = new oathViewability(someDOMElement)
        elementViewability.then(function(detector) {
            detector.getPercent(); // {0-100}
            detector.getVisible(); // {0|1}
        })  
    });
})(window);

```

## Local usage
You can use `npm start` if you want to check demopage on http://localhost:8080/demo/

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