1.0.1 • Published 3 years ago

@dark_insider/botbuilder-storage-mysql v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

State Storage for Bot Framework using Mysql

This project provides a Mysql storage mechanism for Bot Framework-JS SDK V4.

It allows you to store bot state in Mysql, so that you can scale out your bot, and be more resilient to bot server failures.

For more information about the botbuilder community, please visit the botbuilder community project.

Requirements

  • NodeJS 10.x is a requirement to install dependencies, build and run tests.
  • Mysql database.

Installation

npm install @dark_insider/botbuilder-storage-mysql

Sample Usage

const mysqlStorage = new MysqlStorage({
  uri : process.env.MYSQL_URI
});

const conversationState = new ConversationState(mysqlStorage);

Where MYSQL_URI is set in .env

mysql://<username>:<password>@<host>:<port>/<db_name>

Configuration Options

FieldDescriptionValue
uriThe Mysql connection URIRequired
collectionThe name you'd like given to the table the bot will reference.Optional
loggingWhether or not you want logging of transactions enabled.Optional

Caution: you should not store mysql URI in code! Get the uri from a configuration such as environment variable, or a secrets store in your environment. It may contain a sensitive password in the clear and should never be stored in code!


*

  • botbuilder-storage-mysql
  • Copyright 2021 DarkInsider. Released under the terms of the MIT license.