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 🙏

© 2025 – Pkg Stats / Ryan Hefner

quanta.tools

v0.1.0

Published

Quanta.js: JS SDK for Quanta Tools

Readme

Quanta.js

Quanta.js is a lightweight analytics SDK for web applications. It's a JavaScript port of the Quanta Swift SDK, providing the same powerful analytics capabilities for websites and web applications.

Features

  • Simple event tracking with custom parameters
  • Automatic page view tracking
  • User identification and session management
  • A/B testing support
  • Revenue tracking
  • Lightweight and performant

Installation

Option 1: Script Tag

Add the following script tag to your HTML:

<script src="https://js.quanta.tools/app/{YOUR_APP_ID}.js"></script>

Replace {YOUR_APP_ID} with your Quanta application ID.

Option 2: NPM

npm install quanta.tools

Then import it into your application:

import { Quanta } from "quanta.tools";

// Initialize with your app ID
Quanta.initialize("YOUR_APP_ID");

// Track events
Quanta.log("button_click");

Usage

Basic Event Tracking

// When using the script tag:
window.quanta.log("button_click");
window.quanta.log("product_view", { product_id: "123", category: "shoes" });
window.quanta.logWithRevenue("purchase", 29.99, { product_id: "123" });

// When using npm:
import { Quanta } from "quanta.tools";
Quanta.log("button_click");
Quanta.log("product_view", { product_id: "123", category: "shoes" });
Quanta.logWithRevenue("purchase", 29.99, { product_id: "123" });

View Tracking

By default, Quanta automatically tracks page views when the page loads and when navigation occurs (through history API). You can disable this behavior using configuration attributes.

User Identification

Quanta assigns each user a unique ID on their first visit. You can access or set this ID:

// Get the current user ID
const userId = Quanta.getId();

// Set a custom user ID
Quanta.setId("user-123");

Configuration

You can configure Quanta.js behavior using data attributes on the script tag:

<script
  src="https://js.quanta.tools/app/{YOUR_APP_ID}.js"
  data-skip-first-view-event
  data-enable-debug-logs
></script>

Available attributes:

| Attribute | Description | | ---------------------------------- | --------------------------------------------------------- | | data-skip-first-view-event | Skip tracking the initial page view | | data-skip-navigation-view-events | Skip tracking navigation events after the first page view | | data-skip-all-view-events | Disable all automatic page view tracking | | data-enable-debug-logs | Enable debug logging to the console |

Browser Compatibility

Quanta.js works in all modern browsers that support:

  • localStorage
  • fetch API (polyfilled for older browsers)
  • History API

Data Privacy and Compliance

Quanta.js is designed with privacy in mind. User IDs are generated as random UUIDs and then shortened for efficiency. No personal information is collected unless explicitly passed in event parameters. Quanta is GDPR compliant.

Best Practices

  1. Keep event names consistent across your application
  2. Use clear, descriptive event names and parameter keys
  3. Don't include sensitive or personally identifiable information in event parameters
  4. Use revenue tracking for all monetization events

Support

Visit quanta.tools for the iOS SDK, dashboard access, and support resources.