Skip to content

maveio/data

Repository files navigation


mave.io logo black

@maveio/data

Privacy-friendly video analytics client for mave.io.

InstallUsage

Install

Install the package within your project:

npm install @maveio/data

Usage

Initialize the client with your configuration:

import { Metrics } from '@maveio/data';

// Configure the ingestion endpoint
Metrics.config = {
  apiEndpoint: 'https://metrics.video-dns.com/v1/events', // or adjust to your URL
};

To collect video events, create a Metrics instance for each HTMLVideoElement (or hls.js instance).

Standard Video Element

new Metrics('#my_video', 'ubg50LeDE9v86ye').monitor();

The embed_id acts as a unique identifier for the video content.

HLS.js

When using hls.js, pass the hls instance directly:

const hls = new Hls();
// ... setup hls ...

new Metrics(hls, 'ubg50LeDE9v86ye').monitor();

Development

This repository includes a standalone example page in examples/video/index.html.

  1. Build the package:

    npm install
    npm run build
  2. Serve the example page:

    # Proxies events to a local Core instance by default (http://localhost:4000)
    npm run example
    
    # Or specify a custom Core URL:
    MAVE_CORE_BASE_URL=https://your-core-url.com npm run example

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published