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

saashound-node

v0.0.1

Published

Node SaasHound Library

Readme

SaasHound Node.js Client

SaasHound is an essential real-time event tracking and analytics tool that provides insights into your app events, user behavior, and performance metrics, all while simplifying project and team management.

Installation

You can install the SaasHound Node.js client using npm, yarn, or pnpm.

Using npm

npm install saashound-node

Using yarn

yarn add saashound-node

Using pnpm

pnpm add saashound-node

Usage

First, you need to import and initialize the SaasHound client in your Node.js application. You'll need your API token and the project name for which you're tracking events.

Basic Setup

import { SaasHound } from 'saashound-node';

const saashound = new SaasHound({
  token: '<TOKEN>',
  project: '<PROJECT_NAME>'
});

Tracking Custom Events

To track custom events, use the logEvent method. You can pass additional metadata such as a title, description, or tags to enhance your event tracking.

saashound.logEvent({
  title: 'Rocinante Docked at Tycho Station',
  channel: 'docking',
  userId: 'naomi-nagata',
  description: 'The Rocinante successfully docked at Tycho Station.',
  tags: {
    ship: 'Rocinante',
    location: 'Tycho Station',
    mission: 'resupply',
    crew: 4
  }
});

Sending Metrics

To track metrics such as system health, performance indicators, or usage statistics, use the sendMetric method. Metrics can be either a static value or an increment.

saashound.sendMetric({
  title: 'Fuel Reserves',
  value: 85, // Percentage of fuel remaining
  icon: '⛽',
  increment: false
});

Identifying Users

To associate events or metrics with a specific user, use the identify method. This helps in tracking user properties such as name, email, or role.

saashound.identify({
  userId: 'naomi-nagata',
  properties: {
    name: 'Naomi Nagata',
    email: '[email protected]',
    role: 'Chief Engineer',
    affiliation: 'Rocinante',
    origin: 'Belt'
  }
});

Setting and Clearing User IDs

  • Set User ID: You can manually set a userId for tracking purposes if the user is known.

    saashound.setUserId('naomi-nagata');
  • Clear User ID: When the user logs out or when you want to stop associating events with a specific user, you can clear the userId.

    saashound.clearUserId();

Tracking Page Views

Although page views are typically tracked in client-side applications, you can still log page views in a Node.js server if needed (for example, for server-side rendered apps or API tracking):

saashound.logEvent({
  title: 'User Viewed Mission Control Page',
  userId: 'james-holden',
  channel: 'page-views',
  description: 'Captain James Holden accessed the Mission Control page.',
  tags: {
    page: '/mission-control',
    location: 'Rocinante'
  }
});

API Reference

SaasHound Client Initialization

const saashound = new SaasHound({
  token: '<TOKEN>',
  project: '<PROJECT_NAME>'
});
  • token: Your SaasHound API token for authentication.
  • project: The project name or ID you are tracking events for.

Methods

logEvent(eventData: LogEventParams)

Logs a custom event.

  • eventData: An object containing event details like title, channel, userId, description, and tags.

sendMetric(metricData: MetricParams)

Tracks a performance metric.

  • metricData: An object containing metric details like title, value, icon, and increment.

identify(identifyData: IdentifyParams)

Associates user properties with an event.

  • identifyData: An object containing user details like userId, properties (name, email, role, etc.).

setUserId(userId: string | null)

Manually sets the userId for tracking purposes.

  • userId: The identifier of the user.

clearUserId()

Clears the currently set userId.

Official Documentation

For more detailed information and use cases, visit the official SaasHound documentation:

License

This project is licensed under the MIT License.