Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/LogSnag/logsnag.js


https://github.com/LogSnag/logsnag.js

logsnag

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        


LogSnag


LogSnag


Get notifications and track your project events.


NPM Version
Discord
Documentation




## Installation

```sh
npm install --save logsnag
```

## Usage

### Import Library

```js
import { LogSnag } from 'logsnag';
```

### Initialize Client

```js
const logsnag = new LogSnag({
token: '7f568d735724351757637b1dbf108e5',
project: 'my-saas'
});
```

### Track Event

```js
logsnag.track({
channel: "waitlist",
event: "User Joined",
icon: "🎉",
user_id: "user_123",
tags: {
source: "google",
},
notify: true
})
```

### User Properties

```js
logsnag.identify({
user_id: "user_123",
properties: {
name: "John Doe",
email: "[email protected]",
plan: "premium",
}
})
```

### Track Insight

```js
logsnag.insight.track({
title: "User Count",
value: "100",
icon: "👨",
})
```

### Increment Insight

```js
logsnag.insight.increment({
title: "User Count",
value: 1,
icon: "👨",
})
```