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

voltaire-sdk

v1.0.9

Published

Behavioral analytics SDK for Voltaire — tracks paywall events and user intent signals

Downloads

1,059

Readme

voltaire-sdk

Behavioral analytics SDK for Voltaire — tracks paywall events and user intent signals. Works in browsers (via the native Fetch API) and Node.js ≥ 18.


Installation

npm install @voltaire-sdk/web
# or
yarn add @voltaire-sdk/web
# or
pnpm add @voltaire-sdk/web

No external runtime dependencies — the SDK uses the native fetch API available in modern browsers and Node.js ≥ 18.


Quick start

import Voltaire from '@voltaire-sdk/web'

// 1. Initialise once at app startup
Voltaire.init({ apiKey: 'volt_xxx', category: 'productivity' })

// 2. (Optional) Set up automatic paywall triggers
//    After 2 uses of 'export_pdf', a paywall_shown event fires automatically
Voltaire.setPaywallTrigger({ feature: 'export_pdf', threshold: 2 })

// 3. Track events anywhere in your app
Voltaire.track('session_started')
Voltaire.track('feature_used', { feature: 'export_pdf' })
Voltaire.track('feature_gate_hit', { feature: 'export_pdf' })  // user hit premium gate
Voltaire.track('upgrade_clicked')                               // user tapped upgrade CTA
Voltaire.track('paywall_shown')
Voltaire.track('paywall_dismissed')
Voltaire.track('paywall_converted')

API Reference

Voltaire.init(options)

Initialises the SDK. Must be called before any other method.

| Option | Type | Required | Description | |------------|----------|----------|------------------------------------------------------| | apiKey | string | Yes | Your Voltaire API key (volt_xxx) | | category | string | No | App category label appended to every event | | apiUrl | string | No | Override the API base URL (default: https://mcp.hivoltaire.com) |

Voltaire.setPaywallTrigger(trigger)

Registers an automatic paywall trigger.

| Field | Type | Description | |-------------|----------|----------------------------------------------------------| | feature | string | Feature name to monitor | | threshold | number | Number of feature_used events before firing paywall_shown |

Voltaire.track(eventType, properties?)

Tracks an event. Fire-and-forget — always returns void, never throws.

Valid event types:

| Event type | Description | |----------------------|-----------------------------------------------------------------------------| | session_started | User session began | | session_ended | User session ended | | paywall_shown | Paywall was displayed | | paywall_dismissed | User dismissed the paywall | | paywall_converted | User subscribed / purchased | | feature_used | A specific feature was used | | feature_gate_hit | User hit a premium feature gate and was blocked — strongest intent signal | | upgrade_clicked | User tapped an upgrade / pricing CTA but did not complete payment |


Session ID

  • Browser: A UUID is generated once and persisted in localStorage under the key voltaire_session_id. The same ID is reused across page reloads.
  • Node.js: A UUID is generated once when init() is called and kept in memory for the process lifetime.

HTTP contract

Every call to track() sends:

POST https://mcp.hivoltaire.com/api/events
X-Api-Key: volt_xxx
Content-Type: application/json

{
  "event_type": "feature_used",
  "user_session_id": "<uuid>",
  "properties": { "feature": "export_pdf", "category": "productivity" }
}

All requests are non-blocking. Network errors are silently discarded.


Tree-shaking / named imports

import { init, track, setPaywallTrigger } from '@voltaire-sdk/web'

License

MIT