npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@playkit-js/user-kava-consent

v1.1.1

Published

User KAVA Consent plugin for Playkit JS

Readme

@playkit-js/user-kava-consent

Consent controller for KAVA analytics in Kaltura Player v7. The bundle installs a page-wide, fail-closed gate as soon as it is evaluated and gates both KAVA's internal events and direct sendAnalytics calls.

The tested compatibility matrix is:

  • @playkit-js/playkit-js-kava 1.16.1
  • @playkit-js/kaltura-player-js 3.17.77
  • @playkit-js/playkit-js 0.84.x

Loading

Load the scripts before calling KalturaPlayer.setup, in this order:

<script src="kaltura-ovp-player.js"></script>
<script src="playkit-kava.js"></script>
<script src="playkit-user-kava-consent.js"></script>

Enable both runtime plugins:

const player = KalturaPlayer.setup({
  // ...
  plugins: {
    kava: {},
    userKavaConsent: {}
  }
});

Analytics starts disabled. Calls made while disabled resolve immediately and are dropped; they are never queued or replayed.

Message protocol

Grant or revoke consent by posting a boolean consent value:

playerFrame.contentWindow.postMessage({ type: 'userKavaConsent', consent: true }, '*');
playerFrame.contentWindow.postMessage({ type: 'userKavaConsent', consent: false }, '*');

Incoming consent messages are accepted from every origin by default. Set allowedOrigins to restrict accepted MessageEvent.origin values. A '*' entry permits every origin.

When initialized inside a frame, the plugin sends { type: 'userKavaConsentReady' } to its parent and top windows. A shared parent/top target is notified only once. Configure the protocol through the player plugin config:

plugins: {
  userKavaConsent: {
    messageType: 'analyticsConsent',
    readyMessageType: 'analyticsConsentReady',
    allowedOrigins: ['https://embed.example'],
    targetOrigins: ['https://embed.example'],
    consentFieldName: 'privacy.analytics.consent'
  }
}

targetOrigins defaults to ['*']. Each configured value is used as a postMessage target origin for the parent and top windows. When the list contains '*', one wildcard notification is sent per distinct target window.

consentFieldName defaults to consent and supports dot-separated property paths. For example, a value of privacy.analytics.consent reads this message:

{
  type: 'analyticsConsent',
  privacy: { analytics: { consent: true } }
}

Failure behavior

  • If KAVA is absent, an invalid kava fallback is registered so it cannot load later outside the gate.
  • If the exported KAVA class lacks the expected sendAnalytics method, KAVA is disabled through its isValid hook.
  • If an unknown kava plugin is already registered but cannot be patched, startup throws synchronously rather than running analytics without consent enforcement.

Testing

Install the Playwright browsers once after installing dependencies:

yarn playwright install

Run unit, production-bundle, and browser integration tests:

yarn test

Run the Chromium smoke test against the current canary Player and KAVA UMD bundles served by unpkg:

yarn test:e2e:canary

The smoke loads a Kaltura CDN video, verifies that real playback time advances, and checks network requests generated by KAVA's internal playback event handlers while consent is closed, granted, and revoked. The Canary E2E Smoke GitHub Actions workflow runs it every weekday at 06:17 UTC and can also be started manually. It records the resolved canary versions in the Playwright report and uploads the report and failure traces for 14 days.