@kiina/bot-analytics

This package contains the BotAnalytics class, which is used to track the Bot communication data in a 3rd-party tracking platform.

Stats

StarsIssuesVersionUpdatedCreatedSize
@kiina/bot-analytics
1.1.03 years ago3 years agoMinified + gzip package size for @kiina/bot-analytics in KB

Readme

Bot Analytics

This package contains the BotAnalytics class, which is used to track the Bot communication data in a 3rd-party tracking platform.

Installation

npm install @kiina/bot-analytics

Usage

const BotAnalytics = require('@kiina/bot-analytics');

BotAnalytics.API_KEY = '<my-api-key>';

const analytics = new BotAnalytics('1.0.0');
const tracker = analytics.newTrackingContext()
  .setType(Analytics.MessageType.AGENT)
  .setPlatform(Analytics.Platform.FACEBOOK)
  .setUserId('user-id')
  .setMessage('hello world!')
  .setTimestamp(123456)
  .setIntent('intent-name') // not implemented yet
  .setMessageHandled() // Optional: call it only if the message was handled by the bot (no overflow)
  .setSessionId('session-id');

analytics.trackMessage(tracker);

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.