Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krdlab/daab-session
simple session middleware for daab
https://github.com/krdlab/daab-session
daab
Last synced: 16 days ago
JSON representation
simple session middleware for daab
- Host: GitHub
- URL: https://github.com/krdlab/daab-session
- Owner: krdlab
- License: mit
- Created: 2019-01-15T19:35:08.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:39:37.000Z (almost 2 years ago)
- Last Synced: 2024-11-28T09:06:39.010Z (about 1 month ago)
- Topics: daab
- Language: TypeScript
- Size: 2.27 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# daab-session
This library adds support for a conversation session to daab.
## Installation
```sh
npm install daab-session
```## Usage
You can use this library as follows:
```javascript
const { withSession } = require('daab-session');const actions = robot => {
robot.respond(/ping$/i, res => {
let session = res.session; // current session object. it has 'id' and 'data' fields.
...
});
};module.exports = withSession(actions);
```The default store is MemoryStore. There is RedisStore as another store implementation.
More information about usage can be found in the [examples directory](examples/).