deep-bi
v0.1.8
Published
Client library to use the Deep.BI API
Downloads
10
Maintainers
Readme
Client library to use the Deep.BI APIs.
Installation
npm install deep-bi --save
Usage
The examples below assume that you already have service credentials. If not, you will have to create a service in Deep.BI.
var Deep = require('deep-bi');
var deep = new Deep({
ingestKey: '<ingestAPIKey>'
queryKey: '<queryAPIKey>',
streamKey: '<streamKey>
});
Set default project / app attributes
The default attributes will be sent with every event. You can set any attributes you need.
deep.setAppAttributes({
app.name: '<app_name>',
app.version: '<app_version>,
app.you_custom_app_attribute: '<you_custom_app_attribute>'
});
Data ingestion
To send event data to Deep.BI Ingestion API call ingest
method passing event
attribute.
deep.ingest(event)
- the function
ingest
returns a promise event
represents single event in your app and must be in valid JSON format- default app attributes described in the previous section will be added to every event.
Data querying
To query Deep.BI Analytics API call query
method passing query
attribute.
deep.query(query)
- the function
query
returns a promise query
attribute should represent Deep.BI query in valid JSON format
Contact us
Do not hesitate to contact us for any reason related to Deep.BI: [email protected]