Skip to main content

Microsoft Bot Framework

This section describes how to integrate a Microsoft Bot Framework integration channel with Botanalytics.

This section is designed for the the latest version of Botanalytics, which is currently on private beta.

If you would like to join the beta and use the latest version of Botanalytics, follow the instructions.

Integration

Integrating Botanalytics into your Microsoft Bot Framework is quick and easy.

Include Botanalytics

const { MicrosoftBotFrameworkClient } = require('@botanalytics/core');

Create the client

const botanalyticsClient = new MicrosoftBotFrameworkClient();

Configuration options

OptionRequiredDefaultDescriptionEnvironment Variable
apiKeyYesHas no defaultAPI key that is provided when a Universal channel is added to a project.BA_API_KEY
debugNofalseEnables logging. Set this to true to enable.BA_DEBUG
baseUrlNohttps://api.beta.botanalytics.co/v2Base URL to be used for sending requests. Do not change this unless instructed by the Botanalytics team.BA_BASE_URL

Additional environment variables/options

NameRequiredDefaultDescriptionEnvironment Variable
Could only be set via environment variable.NoINFOLog level for the logger. Could be set one of following options 'fatal', 'error', 'warn', 'info', 'debug', 'trace' or 'silent'.BA_LOG_LEVEL
requestRetryLimitNo10Request retry limit for the clientBA_REQUEST_RETRY_LIMIT
requestTimeoutNo30000Request timeout for the clientBA_REQUEST_TIMEOUT

Log messages with Botanalytics client

Add Botanalytics client's middleware by passing botanalyticsClient.middleware() to adapter.use() method.

adapter.use(botanalyticsClient.middleware());

Next Steps