Essentials

Essential packages to build, release, and run great software.

lerna
Contributor Covenant

Example

// Create a Webex bot with Botkit.

const { Botkit } = require("botkit");
const { WebexAdapter } = require("botbuilder-adapter-webex");

const adapter = new WebexAdapter({
  access_token: "<BOT_ACCESS_TOKEN>",
  public_address: "<BOT_URL>",
  secret: "<BOT_SECRET>",
});

const controller = new Botkit({
  adapter,
  webhook_uri: "/api/messages",
});

// Use the product analytics middleware. 👇

const { Analytics } = require("@gve/bot-middleware");

const analyticsMiddleware = new Analytics("<ANALYTICS_API_KEY>");
controller.middleware.receive.use(analyticsMiddleware.trackUserMessage);
controller.middleware.send.use(analyticsMiddleware.trackBotMessage);

Now basic properties from all messages are automatically ✨ sent to analytics, including:

  • message ID
  • message time
  • sender's domain, e.g., cisco.com
  • if the conversation is one-on-one or in a group
  • more!

Installation

Clone this repository.

Install its dependencies with npm.

cd essentials
npm ci

Bootstrap the project with Lerna.

npx lerna bootstrap

License

Apache 2.0

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.