# sqreen-sdk

> SDK for Sqreen signals API

Latest version **0.8.1** (published 2021-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install sqreen-sdk
pnpm add sqreen-sdk
yarn add sqreen-sdk
bun add sqreen-sdk
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.1 |
| Published | 2021-01-05 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Vladimir de Turckheim |
| Maintainers | vdeturckheim, jbaviat, simon-id |

## Links

- npm: https://www.npmjs.com/package/sqreen-sdk
- Repository: https://github.com/sqreen/node-standalone-sdk
- Homepage: https://github.com/sqreen/node-standalone-sdk#readme
- Issues: https://github.com/sqreen/node-standalone-sdk/issues
- npm.io page: https://npm.io/package/sqreen-sdk

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.21.1

## Recent versions

- 0.8.1 (latest) — 2021-01-05
- 0.8.0 — 2020-05-14
- 0.7.0 — 2020-05-11
- 0.6.3 — 2020-03-19
- 0.6.2 — 2020-03-16
- 0.6.1 — 2020-03-16
- 0.6.0 — 2020-03-16
- 0.5.1 — 2020-02-05
- 0.5.0 — 2020-02-04
- 0.4.0 — 2020-01-23
- 0.3.0 — 2020-01-21
- 0.2.1 — 2020-01-17
- 0.2.0 — 2020-01-17
- 0.1.1 — 2020-01-17
- 0.1.0 — 2020-01-17
- … 11 more at https://npm.io/package/sqreen-sdk/versions

## README

# Standalone SDK for Sqreen API

## Usage

### Installation

The module is available as `sqreen-sdk`:
```sh
$ npm i -S sqreen-sdk
```

### Auth

Before sending any signal to [Sqreen ingestion API](https://ingestion.sqreen.com/),
the `init` method must be called first to setup the authentication token and
initialize the batch.

```js
const SqreenSDK = require('sqreen-sdk');
// SqreenSDK.init(token, max batch size, max batch age in seconds)
SqreenSDK.init('<my application token>', 100, 60);
```

The batch is part of the reporting system of the SDK. It means that the signals
placed into it, will be reported together when one of the following condition is
reached:
* the batch size reached it's max value
* the batch is not empty and has not been reported in the interval set as its
max age.

### Creating Points

### Creating Metrics

### Creating Traces

#### HTTP Traces

#### Usage with Express

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