https://github.com/limechain/cli-analytics-sdk
https://github.com/limechain/cli-analytics-sdk
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/limechain/cli-analytics-sdk
- Owner: LimeChain
- Created: 2019-11-01T10:19:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T16:24:59.000Z (over 5 years ago)
- Last Synced: 2025-03-16T21:48:41.927Z (over 1 year ago)
- Language: TypeScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cli-analytics-sdk
With this SDK you can set up a client for a Cli-Analytics App.
Cli-Analytics App is an application specially designed to keep a record of all cli commands that are executed for a certain project. How to build it up for you personal needs, find out [here](https://github.com/LimeChain/cli-analytics)
Insatll the SDK as a npm package:
``` npm install cli-analytics-sdk```
Set up the cli analytics client:
```
const CliAnalyticsClient = require('cli-analytics-sdk');
const analyticsClient = new CliAnalyticsClient({
appId: yourAppId,
url: yourAppUrl
})
```
Where `yourAppId` is the id that would verify your access to the App and `yourAppUrl` is the url that your App is deployed on.
To record a data to your storage:
```
analyticsClient.recordEvent(eventType, metadata);
```
Where `eventType` is the name of the cli command that has been executed and `metadata` is array of command's params values if any.
If you want to query a data:
```
let response = await analyticsClient.getEvents(eventType)
```