# @console-cat/sdk

> Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.

Latest version **0.21.0** (published 2022-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @console-cat/sdk
pnpm add @console-cat/sdk
yarn add @console-cat/sdk
bun add @console-cat/sdk
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.21.0 |
| Published | 2022-07-22 |
| First published | 2022-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 7 |
| Unpacked size | 44.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matt Evenson |
| Maintainers | nsheth12, mevenson |

## Links

- npm: https://www.npmjs.com/package/@console-cat/sdk
- Repository: https://github.com/console-cat/console-cat-sdk
- Homepage: https://github.com/console-cat/console-cat-sdk#readme
- Issues: https://github.com/console-cat/console-cat-sdk/issues
- npm.io page: https://npm.io/package/@console-cat/sdk

## Dependencies (7)

- [url-join](https://npm.io/package/url-join.md) ^5.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) 2
- [async-exit-hook](https://npm.io/package/async-exit-hook.md) ^2.0.1
- [node-machine-id](https://npm.io/package/node-machine-id.md) ^1.1.12
- [@sinclair/typebox](https://npm.io/package/@sinclair/typebox.md) ^0.24.10
- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) ^2.6.2
- [@types/async-exit-hook](https://npm.io/package/@types/async-exit-hook.md) ^2.0.0

## Recent versions

- 0.21.0 (latest) — 2022-07-22
- 0.20.0 — 2022-07-22
- 0.19.0 — 2022-07-21
- 0.18.0 — 2022-07-21
- 0.17.0 — 2022-07-21
- 0.16.0 — 2022-07-21
- 0.15.0 — 2022-07-21
- 0.14.0 — 2022-07-21
- 0.13.0 — 2022-07-21
- 0.12.0 — 2022-07-21
- 0.11.0 — 2022-07-21
- 0.10.0 — 2022-07-20
- 0.9.0 — 2022-07-20
- 0.8.0 — 2022-07-20
- 0.7.0 — 2022-07-20
- … 6 more at https://npm.io/package/@console-cat/sdk/versions

## README

# Node.js SDK

This is the Console Cat Node.js SDK.

*/ᐠﹷ ‸ ﹷ ᐟ\ﾉ* 
## First steps 

To start collecting CLI telemetry, go to the [Console Cat website](https://www.consolecat.dev/), sign in with your GitHub account, and click "Add a CLI".

You'll get a code snippet with your Console Cat **<CLI_ID>** that you can then drop into your Node.js CLI.
## Installation

Download the `@console-cat/sdk` package with your package manager of choice.

### Yarn
```
yarn add @console-cat/sdk
```

### npm
```
npm install @console-cat/sdk
```

## Initialize Console Cat

Once you've installed the SDK package and created a CLI on our website, all that's left is copy-and-pasting a snippet into your CLI's entry point to initialize Console Cat.

Importantly, this snippet should run before anything else in your CLI. Usually it goes in your `index.js` (or `index.ts` if using Typescript). Alternatively, add it to the files linked in `bin` in your `package.json`.

### Javascript
```js
const { ConsoleCat } = require('@console-cat/sdk');
  
ConsoleCat.initialize({
    cliId: "<CLI_ID>",
    version: "<VERSION>", // Should match `version` in your CLI's `package.json`
});
```

### Typescript
```ts
import { ConsoleCat } from '@console-cat/sdk';
  
ConsoleCat.initialize({
    cliId: "<CLI_ID>",
    version: "<VERSION>", // Should match \`version\` in your CLI's `package.json`
});
```
## FAQ

### Q: What information does Console Cat collect?

A: Currently, Console Cat collects the timestamp, version, duration, exit code, and hash of machine UUID / GUID for every command execution. [Here's the code pointer.](https://github.com/console-cat/sdk/blob/master/nodejs/src/index.ts#L8-L22)

### Q: I don't see anything on my charts?!?

A: This means Console Cat hasn't recieved any telemetry from your CLI. After copy-and-pasting the Console Cat snippet, try running your CLI locally and then refresh the dashboard. 

Once it looks like it's working, you'll want to publish a new version of your CLI if using NPM.

If you're still having trouble, [reach out to the Console Cat team](meow@consolecat.dev) and we'll help you get set up.

### Q: Why is the version number wrong?


### Q: What about custom events?

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