Skip to content

bottenderjs/bottender-session-sql

Repository files navigation

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