Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LogSnag/logsnag.js
https://github.com/LogSnag/logsnag.js
logsnag
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/LogSnag/logsnag.js
- Owner: LogSnag
- Created: 2022-01-05T20:19:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T18:31:16.000Z (about 1 year ago)
- Last Synced: 2024-04-25T19:20:57.641Z (5 months ago)
- Topics: logsnag
- Language: TypeScript
- Homepage: https://logsnag.com
- Size: 292 KB
- Stars: 88
- Watchers: 0
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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: "👨",
})
```