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

@scalda/sdk

v0.2.0

Published

Scalda product analytics SDK — browser & Node.js. Event-based, batched, with persisted queue and retry.

Readme

@scalda/sdk

Scalda product-analytics SDK for browser and Node.js. Event-based, with client-side batching, a persisted queue, automatic sessions, and retry with exponential backoff. The SDK is the "thick client" — the server just validates and stores (see the OpenAPI contract at GET /api/analytics/v1/openapi.yaml).

Verification status: conformance-verified locally — 37 unit tests plus the shared cross-language harness bash sdk/e2e.sh typescript (see e2e/README.md). This is the reference SDK against which the other languages' contract is frozen (sdk/CONFORMANCE.md).

Install

pnpm add @scalda/sdk

Browser

import { Scalda } from '@scalda/sdk/browser';

const analytics = new Scalda({ apiKey: 'skc_…' }); // client key (public)

analytics.track('button_clicked', { button_id: 'signup' });
analytics.identify('user_42', { plan: 'pro' });
await analytics.flush();

Node.js

import { Scalda } from '@scalda/sdk/node';

const analytics = new Scalda({ apiKey: 'sks_…' }); // server key (private)

analytics.track('purchase', { amount: 1990, currency: 'RUB' });
analytics.identify('user_42', { plan: 'pro' });
await analytics.flush();      // call on graceful shutdown
await analytics.shutdown();   // final flush + stop the timer

Key kinds. skc_* keys are meant for public client bundles (cannot backdate events). sks_* keys are private, server-side only, and may backdate. Never ship an sks_* key in a browser bundle.

API

| Method | Description | |---|---| | new Scalda(options) | Configure and start. apiKey is required. | | track(name, properties?) | Queue an event. Returns immediately. | | identify(userId, userProperties?) | Bind a user id to this device. | | setUserProperties(properties) | Update user properties without identify. | | reset() | Logout — clear user id and session, keep device id. | | flush() | Force-send the queue. Returns a Promise. | | shutdown() | Final flush + stop the flush timer. |

Options

| Option | Default | | |---|---|---| | apiKey | — | required | | endpoint | Scalda cloud (https://scalda.ai/api/analytics/v1/events) | full URL of …/api/analytics/v1/events | | flushIntervalMs | 10000 | periodic flush | | flushAtQueueSize | 50 | flush when the queue reaches this size | | maxQueueSize | 10000 | drop oldest beyond this (emits $queue_overflow_dropped) | | sessionTimeoutMs | 1800000 | idle timeout that ends a session | | disableSessionTracking | false | | | debug | false | log to console | | optOut | false | GDPR kill switch — everything becomes a no-op | | defaultProperties | {} | merged into every event's properties | | gzip | false | gzip the request body (Node only) |

Development

pnpm install
pnpm typecheck
pnpm test
pnpm build

End-to-end against a local Scalda api: see e2e/README.md.