# logsnag

> LogSnag Client

Latest version **1.0.0** (published 2023-08-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install logsnag
pnpm add logsnag
yarn add logsnag
bun add logsnag
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-08-30 |
| First published | 2022-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 40.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 102 |
| Author | Shayan |
| Maintainers | sh4yy |
| Keywords | logsnag, events, logging |

## Links

- npm: https://www.npmjs.com/package/logsnag
- Repository: https://github.com/LogSnag/logsnag.js
- Homepage: https://github.com/LogSnag/logsnag.js#readme
- Issues: https://github.com/LogSnag/logsnag.js/issues
- npm.io page: https://npm.io/package/logsnag

## Dependencies (1)

- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^3.0.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-08-30
- 1.0.0-beta.6 (beta) — 2023-06-24
- 0.1.8 — 2023-05-09
- 1.0.0-beta.5 — 2023-04-25
- 1.0.0-beta.4 — 2023-04-24
- 1.0.0-beta.3 — 2023-04-24
- 1.0.0-beta.2 — 2023-04-24
- 1.0.0-beta.1 — 2023-03-13
- 0.1.6 — 2022-11-16
- 0.1.5 — 2022-10-27
- 0.1.4 — 2022-10-18
- 0.1.4-beta.1 — 2022-10-17
- 0.1.4-beta.0 — 2022-10-13
- 0.1.3 — 2022-08-08
- 0.1.2 — 2022-07-12
- … 9 more at https://npm.io/package/logsnag/versions

## README

<div align="center">
	<img src="https://logsnag.com/og-image.png" alt="LogSnag"/>
	<br>
    <h1>LogSnag</h1>
	<p>Get notifications and track your project events.</p>
	<a href="https://www.npmjs.com/package/logsnag"><img src="https://img.shields.io/npm/v/logsnag" alt="NPM Version"></a>
	<a href="https://discord.gg/dY3pRxgWua"><img src="https://img.shields.io/discord/922560704454750245?color=%237289DA&label=Discord" alt="Discord"></a>
	<a href="https://docs.logsnag.com"><img src="https://img.shields.io/badge/Docs-LogSnag" alt="Documentation"></a>
	<br>
	<br>
</div>


## 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: "john@doe.com",
      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: "👨",
})
```

---
_Source: https://npm.io/package/logsnag · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
