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

@onlive.ai/tracker

v1.0.46

Published

> Official tracking library and data schemas for the Onlive platform.

Readme

@onlive.ai/tracker

Official tracking library and data schemas for the Onlive platform.

npm version

🌟 Key Features

  • Type Safety: Full TypeScript support with robust property autocomplete.
  • Schema Validation: Uses Zod to strictly validate event payloads at runtime.
  • Modular Design: Easily add, extend, and adapt new events and type schemas.
  • Reusable Property Sets: Define and reuse common property sets across multiple events.

🚀 Quick Start

Installation

Install the package via your preferred package manager:

npm install @onlive.ai/tracker
# or
pnpm add @onlive.ai/tracker
# or
yarn add @onlive.ai/tracker

Basic Example (ESM)

Initialize the Tracker and send an event.

import { Tracker } from '@onlive.ai/tracker';

const tracker = new Tracker({ 
  apiUrl: 'https://srvless.onlive.ai/tracking' // Note: Use https://lfhew0-srvless.onlive.ai/tracking for staging
});

// Track an event
await tracker.send('impression', {
  organization_id: '123e4567-e89b-12d3-a456-426614174000',
  organization_name: 'Example Org',
  widget_id: '123e4567-e89b-12d3-a456-426614174002',
  widget_type: 'OnliveAppChatbot',
  page_url: window.location.href,
  // ... other required properties
});

(Note: Provide all required schema properties according to the event definition).


📖 Usage Options

The library is versatile and published in three standard module formats: ESM, CommonJS, and UMD.

CommonJS

const { Tracker } = require('@onlive.ai/tracker');

const tracker = new Tracker({ apiUrl: 'https://srvless.onlive.ai/tracking' });

CDN / UMD (Browser Script)

If you need to include the tracker directly into a browser environment without a build step:

<script src="https://cdn.onlive.ai/@onlive.ai/tracker@latest/umd/tracker.js"></script>
<!-- Note: You can replace @latest with a specific version to pin a release, e.g., @1.0.45 -->
<script>
  const { Tracker } = window.OnliveTracker;
  const tracker = new Tracker({ apiUrl: 'https://srvless.onlive.ai/tracking' });
  
  tracker.send('impression', {
    // ... payload
  });
</script>

API Endpoints

  • Production: https://srvless.onlive.ai/tracking
  • Staging: https://lfhew0-srvless.onlive.ai/tracking

🏗️ Architecture & Extensibility

The core library is built to be scalable out-of-the-box. Events validate dynamically through definitions located at src/tracker/events/ and partial common subsets under src/tracker/data/.

Extending the Library: Adding a New Event Type

  1. Create the Event definition (src/tracker/events/my-event.ts):

    import { z } from 'zod';
    import { BaseEvent } from './event';
    import { OrganizationData } from '../data/organization.data';
       
    export const MyEvent = BaseEvent.extend({
      ...OrganizationData.shape,
      custom_property: z.string(),
    });
       
    export type MyEvent = z.infer<typeof MyEvent>;
  2. Register the Event (src/tracker/registry.ts):

    import { MyEvent } from './events/my-event';
       
    export const TrackRegistry = {
      // ...existing events
      my_event: MyEvent,
    } as const;

Creating New Reusable Property Sets

  1. Define a Data Model (src/tracker/data/my-properties.data.ts):

    import { z } from 'zod';
       
    export const MyPropertiesData = z.object({
      property1: z.string(),
      property2: z.number().optional(),
    });
  2. Compose directly into an Event:

    import { MyPropertiesData } from '../data/my-properties.data';
    
    export const ExtendedEvent = BaseEvent.extend({
      ...MyPropertiesData.shape,
    });

👨‍💻 Development & Maintenance

Setup Steps

# Install dependencies
pnpm install

# Build everything
pnpm build

Documentation Generator

This repository includes a custom documentation pipeline that parses TypeScript files, JSDoc comments, and Zod schemas to build structured Markdown documentation (docs/tracker-documentation.md).

To generate the docs dynamically:

pnpm generate:docs

Formatting Requirement for JSDoc

For accurate markdown parsing, preserve this block structure spanning your events:

/**
 * @name event_name
 * @description Detailed explanation of what triggers this event.
 *
 * @example
 * {
 *   "custom_property": "example value"
 * }
 */

For individual inner properties:

/**
 * @description Text explaining this property.
 * @example "string-uuid", "custom_id"
 */
property: z.string();

Publishing a New Release

This project uses modern semantic versioning through Changesets.

pnpm changeset         # Create a new changeset configuration
pnpm changeset version # Bump versions automatically
pnpm build             # Important: build the artifacts
pnpm publish           # Publish to npm registry

Onlive Platform – Internal Tracking and Data Models.