• Stars
    star
    234
  • Rank 171,630 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An open tool for designing, building and managing interactive dialog systems

Botkit CMS

An open tool for designing, building and managing interactive dialog systems

Dialog Editor

Install and run it locally

Clone and install botkit-cms

git clone https://github.com/howdyai/botkit-cms.git
cd botkit-cms
npm install

Create an .env file from .env_sample and change the variables

cp .env_sample .env
PLATFORM=web
TOKENS=youwillneverguessmysecretbottoken
USERS=admin:123secret

Create .data folder, create a scripts.json inside. Copy the content from sample-scripts.json

mkdir .data
cp sample_scripts.json .data/scripts.json

Run cms and open localhost:3000/admin and enter the credentials from the USERS env variable.

npm run build
npm start

Create Botkit Dialog Editor & API Service

Clone this repo and set it up on a public host somewhere. Clicking the Glitch link below will do this for you.

Configure the .env file.

Launch the app, then load it in your web browser. You should see a link to the editor screen.

Make sure your new service is available at a public address on the web. Then, modify your Botkit app to include a pointer to this new service.

var controller = Botkit.platform({
  studio_command_uri: 'https://my.new.service',
  studio_token: 'a shared secret'
})

Remix on Glitch

Configuration

Options for this service are controlled via environment variables, which can be stored in a .env file at the project root.

Here is an example .env file:

# Chat platform
# PLATFORM=<platform>
# valid options are slack, teams, ciscospark, web, facebook
PLATFORM=slack

# authentication tokens for Bot users
# TOKENS="123 456"
TOKENS=youwillneverguessmysecretbottoken

# Admin users for UI
# USERS="username:password username2:password2 username3:password3"
USERS=admin:123secret

# LUIS Endpoint
# URL to published LUIS Endpoint in the form of https://<REGION>.api.cognitive.microsoft.com/luis/v2.0/apps/<APPID>?subscription-key=<SUBID>&verbose=true&timezoneOffset=-360&q=
# Get this from LUIS.ai Keys and Endpoint settings
# LUIS_ENDPOINT=

# LUIS App Version
# Defaults to 0.1, update if you manage multiple LUIS app versions
# LUIS_VERSION=0.1

Using LUIS.ai

This project includes support for using LUIS.ai to determine the intent represented by an incoming message. To enable LUIS, add the LUIS_ENDPOINT variable to your environment.

After enabling LUIS, new options will appear in the Trigger dialog that will allow you to assign intents from LUIS as triggers.

Editor Configuration

The Botkit dialog editor can be used in one of several different flavors, controlled by the PLATFORM environment variable.

Value Description
web Botkit Anywhere mode
slack Slack mode
teams Microsoft Teams mode
ciscospark Cisco Spark / Webex Teams mode
facebook Facebook mode

Securing Admin / Editor Access

Access can be limited and users can be controlled using the USERS environment variable.

Set the variable to a space separated list of user:password pairs. Users will be shown a login prompt when accessing any url within the /admin/ url.

Securing API Access

You can lock down access to the API by specifying one or more access tokens in the TOKENS environment variable (or in the .env file).

If any tokens are specified, access to the API requies a valid value in the access_token url query parameter. Botkit will automatically use the Botkit Studio studio_token value for this.

Building Project

Modifications to the front end application or css should be done to their original source files, then compiled by the build process. To build the Javascript and CSS files from their source locations, run the following command:

npm run build

The front end editor application included in this project is built with Angular. The source code of the this application is broken up into several component files in the js/ folder. These are compiled into a single source file and moved to a final home at public/js/scripts.js by the build process.

The CSS is controlled by SASS files in the sass/ folder. These are compiled into a single source file and moved to a final home at public/css/new.css by the build process.

Alternate: Use this as a component in your Botkit App

First, npm install this:

npm install --save botkit-cms

Get your existing scripts from an instance of Botkit CMS, and put the resulting scripts.json into your bot project.

Then, add to your bot's main file, just after defining your controller object:

var cms = require('botkit-cms')();
cms.useLocalStudio(controller);

cms.loadScriptsFromFile(__dirname + '/scripts.json').catch(function(err) {
  console.error('Error loading scripts', err);
});

Note that you might need to modify the call to cms.loadScriptsFromFile depending on where you put the scripts.json file.

More Repositories

1

botkit

Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
TypeScript
11,432
star
2

botmetrics

Analytics and Engagement for Makers and Marketers of Chat and Voice bots
Ruby
236
star
3

botkit-starter-slack

A customizable starting point for building multi-team Slack bots that use the latest APIs
JavaScript
176
star
4

botkit-starter-web

Botkit Anywhere - a starter kit for building a bot that lives in your website or app
JavaScript
111
star
5

botkit-middleware-witai

Middleware for using Wit.ai with Botkit-powered bots
JavaScript
87
star
6

botkit-storage-mongo

A MongoDB storage driver for Botkit
JavaScript
54
star
7

botkit-starter-facebook

A customizable starting point for building Facebook bots
JavaScript
53
star
8

botkit-rasa

a plugin to connect Botkit to the rasa NLU api
JavaScript
40
star
9

botkit-storage-firebase

Firebase storage module for Botkit
JavaScript
34
star
10

botkit-starter-ciscospark

A customizable starting point for building Cisco Spark bots
JavaScript
28
star
11

botkit-storage-redis

Redis storage module for Botkit
JavaScript
27
star
12

botkit-starter-slackrtm

A starter kit for building bots with Botkit and the Slack RTM api
JavaScript
26
star
13

botkit-studio-sdk

Direct access to the Botkit CMS APIs
JavaScript
23
star
14

botkit-docs

Documentation for #botkit
18
star
15

botkit-starter-teams

Starting point for building a bot for Microsoft Teams
JavaScript
13
star
16

studio-examples

sample skills and scripts for use with Botkit Studio
JavaScript
7
star
17

botkit-storage-base

A sample repo for use in creating new storage modules for Botkit
7
star
18

botkit-starter-googlehangouts

A customizable starting point for building Google Hangouts Chat Bots
JavaScript
5
star
19

botkit-studio-metrics

DEPRECATED
JavaScript
2
star
20

.github

howdyai GitHub org configuration
1
star
21

trello-ciscospark

A reference design for a Cisco Spark bot that works with Trello
JavaScript
1
star