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

zoomianalytics

v1.1.26

Published

A JavaScript/TypeScript library for tracking and sending analytics events.

Downloads

50

Readme

ZoomiAnalytics

ZoomiAnalytics is a JavaScript/TypeScript library for tracking user activities and sending analytics events to a specified server endpoint. It helps you collect data on user interactions with various types of content (e.g., videos, podcasts, text) and track events like starting, pausing, and completing content.

Features

  • Track user events such as start, end, play, pause, etc.
  • Support for multiple content types, including video, podcast, text, and more.
  • Events are sent in batches to a configurable server endpoint.
  • Supports automatic event sending upon page navigation or tab/browser closure.
  • Configurable batch size and event retry logic.
  • Collect detailed playback data like currentPosition, isPlaying, and currentPlaybackRate.
  • Handles navigation changes (e.g., window.location.pathname) and tab closure to ensure events are sent before the page is unloaded.

Installation

To install ZoomiAnalytics via npm, use the following command:

npm install zoomianalytics

Usage

Initialization Before you can start tracking events, initialize the ZoomiAnalytics instance with your API key and the server endpoint URL.

import ZoomiAnalytics from "zoomianalytics";

const apiKey = "your-api-key";
const apiName = "your-api-name"; // Name of the API that will process the events

const analytics = new ZoomiAnalytics(apiKey, apiName);

Track Events

You can track events by calling the trackEvent() method. The trackEvent method requires an event object with the following properties:

  • userId: The ID of the user triggering the event.
  • courseId: The ID of the course being interacted with.
  • courseItemId: The ID of the content item (e.g., video, podcast).
  • contentType: The type of content being interacted with. Possible values are Video, Podcast, Text, Course, etc.
  • courseTitle: The title of the course (optional).
  • eventType: The type of event (e.g., start, end, pause, complete).
  • currentPosition: The current playback position in the content.
  • isPlaying: Whether the content is currently playing.
  • currentPlaybackRate: The playback rate of the content.
  • newPosition: The new position after a change in the content.
const event = {
  userId: 123,
  courseId: 456,
  courseItemId: 789,
  contentType: ContentItemTypes.Video (|| 0),
  eventType: EventTypes.Play (|| 3),
  currentPosition: 120,
  isPlaying: true,
  currentPlaybackRate: 1.0,
  newPosition: 130,
  courseTitle: 'Couse Name',
  contentDuration: 456.5 (value in seconds)
};

analytics.trackEvent(event);