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

@nettrek/c2pa-hls-bridge

v0.1.0

Published

A lightweight integration layer that connects **C2PA WebAssembly verification** with **HLS.js** at fragment-level. It enables real-time validation of signed media segments using C2PA manifests while streaming via HLS. Demo: [0.1.0 build](https://clien

Readme

@nettrek/c2pa-hls-bridge

A lightweight integration layer that connects C2PA WebAssembly verification with HLS.js at fragment-level.
It enables real-time validation of signed media segments using C2PA manifests while streaming via HLS.
Demo: 0.1.0 build

Features

  • ✅ Intercepts fragment loading in HLS.js
  • ✅ Extracts raw fragment bytes and validates them via @contentauth/c2pa-web (WASM)
  • ✅ Maintains a time-code mapped interval tree for quick C2PA lookups
  • ✅ Detects tampering, AI-generated content, missing signatures
  • ✅ Exposes a minimal, high-level API (C2paHlsBridge)

Installation

From npm

npm install @nettrek/c2pa-hls-bridge

Local install (for development)

npm install ../path/to/dist

Build the library (local development)

npm install
npm run build

Usage

Minimal example

import Hls from "hls.js";
import { C2paHlsBridge } from "@nettrek/c2pa-hls-bridge";

const video = document.querySelector("video");
const hls = new Hls();

const bridge = new C2paHlsBridge({ enableTrustListVerification: false }, hls);

hls.on(Hls.Events.MEDIA_ATTACHED, () => {
  hls.loadSource("https://example.com/master.m3u8");
});

hls.attachMedia(video);

video.addEventListener("timeupdate", () => {
  const reader = bridge.getC2PAMetaByTimeCode(video.currentTime);
  if (!reader) return;

  reader.containsSignature();
  reader.isValid();
  reader.containsAIGeneratedContent();
  reader.getValidationErrors();
});

API

C2paHlsBridge

class C2paHlsBridge {
  constructor(config: C2PAConfig, hls: HlsInstance)

  getC2PAMetaByTimeCode(timeCode: number): C2paManifestHelper | null
  getTamperedWithIntervals(): Interval[]
  libReady(): boolean
  dispose(): void
}
  • constructor(config: C2PAConfig, hls: HlsInstance) - Creates a new C2paHlsBridge instance for the given HLS.js instance.
  • getC2PAMetaByTimeCode(time: number) - Returns a C2paManifestHelper for the active segment at the given playback time. The ManifestHelper exposes methods for validating the segment and retrieving metadata.
  • getTamperedWithIntervals() - Returns an array of intervals that have been tampered with.
  • libReady() - Returns true if the C2PA WebAssembly library is ready.
  • dispose() - Disposes the C2paHlsBridge instance.

C2PAConfig

interface C2PAConfig {
    enableTrustListVerification: boolean;
}
  • enableTrustListVerification - Enables or disables trust list verification (requires network access)

C2paManifestHelper

class C2paManifestHelper {
    containsSignature(): boolean
    isValid(): boolean
    containsAIGeneratedContent(): boolean
    getValidationErrors(): ValidationStatus[]
    getManifestMap(): Record<string, Manifest>
    getActiveManifest(): Manifest | null
    getCustomMetadata (identifier: string, manifest?: Manifest): any | null
    getItem (item: C2paFormatedItemType): string | boolean
    toString(): string
  • containsSignature() – Returns true if a valid manifest/signature is present.
  • isValid() – Indicates whether the manifest passes validation without errors.
  • containsAIGeneratedContent() – Detects if any manifest indicates AI-generated content.
  • getValidationErrors() – Returns an array of validation errors if present.
  • getManifestMap() – Returns the full set of manifests indexed by manifest ID.
  • getActiveManifest() – Returns the currently active manifest or null.
  • getCustomMetadata(identifier, manifest?) – Retrieves custom assertion data by identifier. If no manifest is provided, the active manifest is used.
  • getItem(type: C2paFormatedItemType) – Returns a formatted human-readable value (enum one of C2paFormatedItemType - issuer, date, status).
  • toString() – Returns a pretty-printed JSON representation of the full manifest store (recursion-safe)

References

Supporters

  • This Opensource Repo is being supported by Westdeutscher Rundfunk, CCAV (Competence Center Audio and Video).