@xnestjs/redisess v1.7.0
@xnestjs/redisess
NestJS extension library for Redisess
Install
npm install @xnestjs/redisess
# or using yarn
yarn add @xnestjs/redisessUsage
Register sync
An example of nestjs module that import the @xnestjs/mongodb
// module.ts
import { Module } from '@nestjs/common';
import { RedisessModule } from '@xnestjs/redisess';
const client = new Redis();
@Module({
    imports: [
        RedisessModule.forRoot({
            useValue: {
                client,
                namespace: 'sessions',
            },
        }),
    ],
})
export class MyModule {
}Register async
An example of nestjs module that import the @xnestjs/mongodb async
// module.ts
import { Module } from '@nestjs/common';
import { RedisessModule } from '@xnestjs/redisess';
const client = new Redis();
@Module({
    imports: [
        RedisessModule.forRootAsync({
            inject: [ConfigModule],
            useFactory: (config: ConfigService) => ({
                client,
                namespace: config.get('SESSION_NAMESPACE'),
            }),
        }),
    ]
})
export class MyModule {
}Environment Variables
The library supports configuration through environment variables. Environment variables below is accepted. All environment variables starts with prefix (RMQ_). This can be configured while registering the module.
<--- BEGIN env --->
| Environment Variable | Type | Default | Description | 
|---|---|---|---|
| SESSION_NAMESPACE | String | ||
| SESSION_TTL | Number | 1800 | Time-To-Live value in seconds | 
| SESSION_WIPE_INTERVAL | Number | 5000 | Interval in ms to run wipe process | 
<--- END env --->
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago