sqreen-sdk
v0.8.1
Published
SDK for Sqreen signals API
Downloads
8,485
Readme
Standalone SDK for Sqreen API
Usage
Installation
The module is available as sqreen-sdk
:
$ npm i -S sqreen-sdk
Auth
Before sending any signal to Sqreen ingestion API,
the init
method must be called first to setup the authentication token and
initialize the batch.
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.