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

@vidinfra/pulse

v2.0.5

Published

The web client for Vidinfra Pulse

Readme

Vidinfra Pulse

Web client for collecting page views and media playback events with Vidinfra Pulse.

Installation

npm / yarn

npm i @vidinfra/pulse
# or
yarn add @vidinfra/pulse

CDN / IIFE (Script Tag)

Add the following script tag to your HTML. All exports are available under the VidinfraPulse global.

<!-- Production (minified) -->
<script src="https://unpkg.com/@vidinfra/pulse/dist/index.global.js"></script>

<!-- Development (unminified, with readable source) -->
<script src="https://unpkg.com/@vidinfra/pulse/dist/index.global.dev.js"></script>

Then use it directly in your page:

<script>
  VidinfraPulse.initTracking({
    endpoint: 'https://<organization>.pulse.vidinfra.com/t/v1/<project-id>/<platform-id>',
    debugMode: true,
  });
</script>

To track media players via the IIFE build:

<video
  id="my-video"
  data-media-id="video-123"
  data-media-type="movies"
  title="My Video"
  src="video.mp4"
  controls
></video>

<script>
  var player = VidinfraPulse.addPlayer(document.getElementById('my-video'));

  // To stop tracking later:
  // VidinfraPulse.removePlayer(player);
</script>

Usage (ES Modules)

React / Next.js

// layout.tsx
import { initTracking } from '@vidinfra/pulse';

initTracking({
  endpoint: 'https://<organization>.pulse.vidinfra.com/t/v1/<project-id>/<platform-id>',
  debugMode: true,
});

Library-scoped data

To scope data to a specific video library, pass library_id as a query parameter in the endpoint URL:

initTracking({
  endpoint: `https://<organization>.pulse.vidinfra.com/t/v1/<project-id>/<platform-id>?library_id=<library-id>`,
});

Query parameters in the endpoint URL are preserved and forwarded to all requests.

Media

// player.tsx
import { addPlayer, removePlayer } from '@vidinfra/pulse/media';
import { useEffect, useRef } from 'react';

export function YourPlayer({ video }: Props) {
  const playerRef = useRef(null);

  useEffect(() => {
    if (!playerRef.current) return;
    const analPlayer = addPlayer(playerRef.current);

    return () => {
      removePlayer(analPlayer);
    };
  }, [playerRef.current]);

  return (
    <video
      ref={playerRef}
      width="800"
      height="450"
      data-media-id={video.id}
      data-media-type="movies"
      title={video.title}
      src={video.src}
      poster={video.poster}
      controls
      autoPlay
    ></video>
  );
}

Configuration Options

| Option | Type | Default | Description | | ---------------------- | ---------- | ------- | ------------------------------------------------ | | endpoint | string | — | Required. Your Vidinfra Pulse endpoint URL. Supports query parameters (e.g. ?library_id=xxx). | | hashMode | boolean | false | Use hash-based routing for page tracking. | | trackPage | boolean | true | Enable page view collection. | | trackMedia | boolean | true | Enable media playback collection. | | autoDiscoverPlayers | boolean | false | Auto-detect <video> elements on page navigate. | | pageViewDelay | number | 10 | Delay (ms) before recording a page view. | | debugMode | boolean | false | Log internal events to the console. | | userGetter | function | — | Callback that returns user info. | | pageMetaGetter | function | — | Callback that returns extra page metadata. |