1.1.2 • Published 2 years ago
loggermonk v1.1.2
Installation
If you are using npm:
npm install --save loggermonkIf you are using yarn:
yarn add loggermonkUsage
Import Library
import { LoggerMonk } from 'loggermonk';Configuring The Client
You need to create a new instance of LoggerMonk with three mandatory parameters:
token: Your project token from LoggerMonk dashboard.project: Your project name from LoggerMonk dashboard.site: Your site name from LoggerMonk dashboard.
const loggermonkClient = new LoggerMonk({
token: '7f568d735724351757637b1dbf108e5',
project: 'my-saas'
});Track Event
loggermonkClient.track({
channel: "waitlist",
event: "User Joined",
icon: "🎉",
user_id: "user_123",
tags: {
source: "google",
},
notify: true
})User Properties
loggermonkClient.identify({
user_id: "user_123",
properties: {
name: "John Doe",
email: "john@doe.com",
plan: "premium",
}
})Track Insight
loggermonkClient.insight.track({
title: "User Count",
value: "100",
icon: "👨",
})Increment Insight
loggermonkClient.insight.increment({
title: "User Count",
value: 1,
icon: "👨",
})