Socket
Book a DemoInstallSign in
Socket

@kiina/bot-analytics

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kiina/bot-analytics

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

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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);

FAQs

Package last updated on 12 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts