This repository is for an SDK to Kloudspot Analytics
Created Jan 31st 2020 - Version 1.0.0
- Checkout the repository
- Navigate to the
kloudspot-analytics-node-sdk
directory - Run
npm install
to install dependencies - Your SDK is now ready to be used
- Navigate to
test
directory - Run
node client.js
The SDK should connect to Kloudspot Analytics Platform and retrieve client analytics data.
- You need to have a valid account on Kloudspot Analytics Platform
- You need to get ID and SecretKey from your Account. Please click on the "Gear" icon on the top menubar and select "API Keys"
- If there is not one present, click on "New API Key" to generate one.
Using the SDK is pretty straight forward. Here is a sample code to import the SDK and connect to Kloudspot Analytics Platform
//1) Import Kloudspot Analytics library (from wherever it is located)
var KloudspotInsights = require('kloudspot-analytics-node-sdk');
//2) Create a Kloudspot Analytics client by providing the host URL, ID and SecretKey (can get one from your Account Settings page, see pre-requisites section above)
var ksClient = new KloudspotInsights({
'host': '<your kloudspot instance baseurl>',
'id': '<your kloudspot clientID>',
'secretKey': '<your kloudspot clientSecret>'
});
//3) Get the list of sites
ksClient.siteHierarchy.sites().then(function(response) {
//Response should contain all the sites in the system
if(response && Array.isArray(response)) {
console.log('Number of sites in the system: '+response.length);
} else {
console.log(response);
}
});
For any further questions on using the SDK, please contact -
- Uday Pyda (uday@kloudspot.com)