@mashroom/mashroom-session-provider-mongodb
v2.7.1
Published
Mashroom Server MongoDB provider
Downloads
18
Readme
Mashroom Session MongoDB Provider
Plugin for Mashroom Server, a Microfrontend Integration Platform.
This plugin adds a mongoDB session store that can be used by Mashroom Session. Actually this is just a wrapper for the connect-mongo package.
Usage
If node_modules/@mashroom is configured as plugin path just add @mashroom/mashroom-session-provider-mongodb as dependency.
Activate this session provider in your Mashroom config file like this:
{
"plugins": {
"Mashroom Session Middleware": {
"provider": "Mashroom Session MongoDB Provider"
}
}
}
And to change the default config of this plugin add:
{
"plugins": {
"Mashroom Session MongoDB Provider": {
"client": {
"uri": "mongodb://localhost:27017/mashroom_session_db?connectTimeoutMS=1000&socketTimeoutMS=2500",
"connectionOptions": {
"minPoolSize": 5,
"serverSelectionTimeoutMS": 3000
}
},
"collectionName": "mashroom-sessions",
"ttl": 86400,
"autoRemove": "native",
"autoRemoveInterval": 10,
"touchAfter": 0,
"crypto": {
"secret": false
}
}
}
}
- client: Options to construct the client. connectionOptions are passed to the mongodb driver.
- collectionName: Mongo collection to store sessions (Default: mashroom-sessions)
- ttl: TTL in seconds (Default: 86400 - one day)
- autoRemove: Session remove strategy (Default: native)
- autoRemoveInterval: Remove interval in seconds if autoRemove is interval (Default: 10)
- touchAfter: Interval in seconds between session updates (Default: 0)
- crypto: Options regarding session encryption. For details see connect-mongo.