saashound-js
v0.0.4
Published
Monitor and track what's happening in your javascript application including Node.js/Angular/React/React-Native/Vue and more.
Downloads
8
Maintainers
Readme
SaasHound
Monitor and track what's happening in your javascript application including Node.js/Angular/React/React-Native/Vue and more.
Installation
yarn add saashound
or
npm install saashound
Usage
Import Library
import SaasHound from 'saashound';
Setup Client
const saashound = new SaasHound({
project: '<your-project-name>',
token: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
});
Tracking events
const onSignUpComplete = (params) => {
// log event
const { user } = params;
saashound.logEvent({
title: "User registered",
channel: "user-actiity",
icon: '🎊',
message: user.first_name + " has registered",
notify: true,
tags: {
userId: user.id,
username: user.username,
email: user.email,
},
});
};
Send metrics
const onSignUpComplete = (params) => {
// update metrics
saashound.sendMetric({
name: "User Count",
increment_by: 1,
icon: "🧾",
});
};
You can also use our builder to quickly prototype and publish new events and metrics.