bottender-session-sql

0.1.1 • Public • Published

bottender-session-sql

npm Build Status License: MIT

SQL Session Store for Bottender.

Installation

npm install bottender-session-sql

Usage

Publish migrations:

npx bottender-session-sql migrations:publish

Code example:

const { ConsoleBot } = require('bottender');
const SQLSessionStore = require('bottender-session-sql');
 
const bot = new ConsoleBot({
  sessionStore: new SQLSessionStore({
    client: 'pg',
    connection: {
      host: '127.0.0.1',
      user: 'your_database_user',
      password: 'your_database_password',
      database: 'myapp_test',
    },
    migrations: {
      tableName: 'migrations',
    },
  }),
});

Options

config

Knex config.

expiresIn

Default: 365 * 24 * 60.

Examples

See examples folder.

License

MIT © Yoctol

Package Sidebar

Install

npm i bottender-session-sql

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

8.84 kB

Total Files

30

Last publish

Collaborators

  • chentsulin
  • etrexkuo
  • tw0517tw
  • link515