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

@trackingkoala/sdk

v1.0.0

Published

SDK for TrackingKoala API

Readme

@trackingkoala/sdk

Official Node.js SDK for TrackingKoala.

Installation

npm install @trackingkoala/sdk
# or
pnpm add @trackingkoala/sdk

Usage

import {
  TrackingKoala,
  TrackingKoalaApiError,
  TrackingKoalaNetworkError,
  TrackingKoalaValidationError
} from "@trackingkoala/sdk";

const koala = new TrackingKoala("YOUR_API_KEY", {
  timeoutMs: 10000
});

try {
  await koala.track({
    cost: 150,
    // amount: 150, // alias for cost
    charge: 299,
    currency: "USD",
    environment: "production",
    provider: "openai",
    action: "signup",
    userId: "usr_123",
    traces: ["trace_abc"],
    tags: ["signup", "conversion"],
    metadata: {
      plan: "pro",
      source: "google_ads"
    }
  });
} catch (error) {
  if (error instanceof TrackingKoalaValidationError) {
    console.error("Validation failed", error.issues);
  } else if (error instanceof TrackingKoalaApiError) {
    console.error("API failed", error.status, error.responseBody);
  } else if (error instanceof TrackingKoalaNetworkError) {
    console.error("Network failed", error.message);
  } else {
    throw error;
  }
}

Template Execution

const result = await koala.rateTemplate({
  templateId: "tmpl_openai_pricing",
  mode: "preview", // or "track"
  inputs: {
    model: "gpt-4.1",
    input_tokens: 1200,
    output_tokens: 450
  },
  event: {
    source: "template",
    provider: "openai",
    action: "summarize"
  }
});

console.log(result.cost, result.charge, result.breakdown);

Client Validation

  • cost (or amount) must be a finite number greater than 0.
  • charge, when provided, must be a finite number greater than 0.
  • If both cost and amount are provided, they must be equal.
  • userId is the canonical identity field. customerId is still accepted as a backward-compatible alias.
  • If both userId and customerId are provided, they must be equal.
  • tags and traces default to [] when omitted.

IntelliSense and Method Docs

The SDK ships with TypeScript declarations and JSDoc comments on constructor options, methods, and errors so editors show inline usage details.

Publishing to Private Registry

To publish this package to a private registry (e.g. GitHub Packages or a self-hosted Verdaccio instance):

  1. Configure .npmrc: Create a .npmrc file in the project root or user home directory with the registry URL and authentication token.

    //npm.pkg.github.com/:_authToken=YOUR_TOKEN
    @trackingkoala:registry=https://npm.pkg.github.com
  2. Update package.json: Ensure the publishConfig points to your registry.

    "publishConfig": {
      "registry": "https://npm.pkg.github.com"
    }
  3. Publish: Run npm publish or pnpm publish.

Development

  • pnpm build: Build the package
  • pnpm dev: Watch mode