Standalone SDK for Sqreen API
The module is available as
$ npm i -S sqreen-sdk
Before sending any signal to Sqreen ingestion API,
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.