{"id":23532634,"url":"https://github.com/outbrain-inc/viewabilityhelper","last_synced_at":"2025-08-07T18:00:38.337Z","repository":{"id":41176308,"uuid":"91689670","full_name":"outbrain-inc/ViewabilityHelper","owner":"outbrain-inc","description":"Lightweight cross-browser library that enables you to create a watcher for a given element, and receive a callback for it's intersections with the viewport","archived":false,"fork":false,"pushed_at":"2023-03-31T12:19:07.000Z","size":109,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-20T01:19:24.874Z","etag":null,"topics":["ads","intersection-observer","outbrain","pixels","viewability"],"latest_commit_sha":null,"homepage":"https://outbrain.github.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outbrain-inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-18T12:15:34.000Z","updated_at":"2024-11-11T18:33:36.000Z","dependencies_parsed_at":"2024-11-12T17:02:42.804Z","dependency_job_id":"509ed07f-7048-4232-a401-a2c9b0a82e38","html_url":"https://github.com/outbrain-inc/ViewabilityHelper","commit_stats":null,"previous_names":["outbrain-inc/viewabilityhelper","outbrain/viewabilityhelper"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outbrain-inc%2FViewabilityHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outbrain-inc%2FViewabilityHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outbrain-inc%2FViewabilityHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outbrain-inc%2FViewabilityHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outbrain-inc","download_url":"https://codeload.github.com/outbrain-inc/ViewabilityHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249834826,"owners_count":21331994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ads","intersection-observer","outbrain","pixels","viewability"],"created_at":"2024-12-25T23:12:08.984Z","updated_at":"2025-04-22T22:41:20.599Z","avatar_url":"https://github.com/outbrain-inc.png","language":"JavaScript","readme":"# ViewabilityHelper\n\n[![Build Status](https://travis-ci.org/outbrain/ViewabilityHelper.svg?branch=master)](https://travis-ci.org/outbrain/ViewabilityHelper) [![npm version](https://badge.fury.io/js/viewability-helper.svg)](https://badge.fury.io/js/viewability-helper)\n\n\nLightweight cross-browser library that enables you to create a watcher for a given element, and get back a callback when it has entered the viewport\n\nViewability Helper uses [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API \"Intersection Observer API\") if available. If it's not, the library makes the calculations itself.\nBrowser support for the Intersection Observer API can be found [here](http://caniuse.com/#search=intersectionobserver \"here\").\n\n*Note:* Not working when Intersection Observer is not supported and the script is running inside an iframe.\n\n# Install\n\n```js\nnpm install --save viewability-helper\n```\n\n# Usage\n\n```js\n// import the module\nimport ViewabilityHelper from 'viewability-helper';\n// -or-\nconst ViewabilityHelper = require('viewability-helper');\n\n// Create a new observer for an element with a callback function\nconst myObserver = new ViewabilityHelper(element, callback);\n// Fire in the hole!\nmyObserver.observe();\n\n// With options\nmyObserver = new ViewabilityHelper(element, callback, {callbackParams: ['Element number 1']});\n\n```\n\n\n# Options\n\n**callbackParams** (Array) - List of parameters passed to the callback function\n\n**intersectPercentage** (String) - Intersection percentage, ex: \"0\", \"0.2\" etc..\n\n**scrollDimmer** (Integer) - Interval for triggering element viewability watch (msec)\n\n**unobserve** (Boolean) - Should the observer keep observing the element after first viewability event or not\n\n**rootMargin** (String) - For Intersection Observer API, The root element margin\n\n**threshold** (Array) - For Intersection Observer API, List of intersection ratio thresholds of the element with the viewport\n\n\n\n# Contribute\n\nPlease first fork this repository, make your changes and then create a pull request.\n\nStart by \n```js\nnpm install\n```\n\nAnd then build it with\n```js\nnpm run dev\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutbrain-inc%2Fviewabilityhelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutbrain-inc%2Fviewabilityhelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutbrain-inc%2Fviewabilityhelper/lists"}