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

open-sdk-analytics

v1.0.0

Published

Vendor-neutral, privacy-friendly, zero-dependency analytics SDK and self-hostable ingestion engine

Readme

Open SDK Analytics (Vendor-Neutral, Zero-Lock-in)

Builder: Sohan Ananthula

An open-source, vendor-neutral alternative to @enter-pro/analytics-sdk. Zero runtime dependencies, resilient offline queueing, automatic SPA page tracking, Web Vitals, active session timing, declarative DOM click/submit tracking, and user identity resolution (identify).


Why Open SDK Analytics?

The @enter-pro/analytics-sdk has several critical vendor locks:

  1. Hardcoded Proprietary Backend: Pointed by default to https://api.enter.pro/code/api/v1/track.
  2. Server-Side Event Registration Barrier: If you call trackEvent('button_clicked') without first registering button_clicked with Enter's proprietary backend API (POST /v1/projects/:pid/analytics/events/registry), Enter's server rejects the events with rejected.reason: "event not registered".
  3. No User Identity Tracking: The original Enter SDK has no identify(userId, traits) method.
  4. Hardcoded Namespaces: Enter-specific keys (enter.analytics.visitor_id, VITE_ENTER_*).

Open SDK Analytics removes all these restrictions:

  • Send events to any endpoint: your own backend, a webhook, ClickHouse, Supabase, PostHog, or the included self-hosted receiver.
  • Track any event freely without pre-registering it with an external proprietary API.
  • Full identify(userId, traits) and resetIdentity() support.
  • 100% Drop-in backward compatibility with @enter-pro/analytics-sdk (same exports and function signatures).

Quick Start

1. Installation

npm install open-sdk-analytics

2. Modern API

import { initAnalytics, track, identify } from 'open-sdk-analytics';

// Initialize at app entry
initAnalytics({
  endpoint: 'https://analytics.yourdomain.com/api/v1/track', // or '/api/track'
  appId: 'my-project',
  debug: true
});

// Track custom events freely
track('pricing_viewed', {
  properties: { plan: 'pro', billing: 'annual' }
});

// Identify logged-in users
identify('usr_98765', {
  traits: { email: '[email protected]', tier: 'enterprise' }
});

3. Drop-in Replacement for @enter-pro/analytics-sdk

If you are migrating existing code that used @enter-pro/analytics-sdk:

- import { bootstrapEnterAnalytics, trackEvent } from '@enter-pro/analytics-sdk';
+ import { bootstrapEnterAnalytics, trackEvent } from 'open-sdk-analytics';

bootstrapEnterAnalytics();
trackEvent('button_click', { properties: { cta: 'hero' } });

Features

  • Automatic SPA Route Tracking: Listens to pushState, replaceState, popstate, and optional hash routing.
  • Accurate Active Session Duration: Tracks actual visible tab time (time_on_page_ms), pauses when tab is hidden.
  • Web Vitals & Performance: Native PerformanceObserver fallbacks for LCP, FCP, CLS, TTFB, and DOMContentLoaded.
  • Error & Rejection Capture: Automatic error listener with third-party marketing noise filtering.
  • Declarative DOM Event Listeners: Attach tracking to CSS selectors (click, submit) with automatic property extraction (attribute, dataset, formField, etc.).
  • Offline Resilient Outbox: Queues events in localStorage, batches up to 20 events, flushes on interval, handles exponential jittered retries, and sends keepalive beacons on page exit.

Self-Hosting the Ingestion Backend

A lightweight, zero-dependency ingestion server is included in server/ingest.js.

node server/ingest.js

It accepts incoming POST requests at /api/v1/track and appends verified events directly to events.jsonl (or your chosen database).