@kiina/bot-analytics

    1.1.0 • Public • Published

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

    Keywords

    none

    Install

    npm i @kiina/bot-analytics

    DownloadsWeekly Downloads

    1

    Version

    1.1.0

    License

    none

    Unpacked Size

    5.86 kB

    Total Files

    6

    Last publish

    Collaborators

    • asalgado
    • eder_kiina
    • antunesmg
    • marcojardim