botbuilder-storage-postgres

1.1.3 • Public • Published

[Github All Releases]FOSSA Status () License: MIT Twitter FOSSA Status

State Storage for Bot Framework using Postgres

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

It allows you to store bot state in Postgres, 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.
  • Postgres database.

Installation

npm install botbuilder-storage-postgres

Sample Usage

const postgresStorage = new PostgresStorage({
  uri : process.env.POSTGRES_URI
});
 
const conversationState = new ConversationState(postgresStorage);

Where POSTGRES_URI is set in .env or your secrets store of choice according to LibPQ Connection String standards. E.g.

postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...]

Configuration Options

Field Description Value
uri The Postgres connection URI Required
collection The name you'd like given to the table the bot will reference. Optional
logging Whether or not you want logging of transactions enabled. Optional

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

See Postgres Connection URI format in the official documentation to learn more about the connection uri parameter value.


*

  • botbuilder-storage-postgres
  • Copyright 2019 TD Ameritrade. Released under the terms of the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i botbuilder-storage-postgres

Weekly Downloads

10

Version

1.1.3

License

MIT

Unpacked Size

190 kB

Total Files

28

Last publish

Collaborators

  • roeintense