@universal-packages/token-registry-redis
v1.3.11
Published
Redis engine for universal-token-registry
Downloads
28
Readme
Token Registry Redis
Redis engine for universal-token-registry.
Install
npm install @universal-packages/token-registry-redis
npm install @universal-packages/token-registry
npm install redis
RedisEngine
Just pass this engine to the registry to enable it to use ready as the storage engine.
import { Registry } from '@universal-packages/universal-token-registry'
import { RedisEngine } from '@universal-packages/universal-token-registry-redis'
const registry = new Registry({ engine: 'redis', engineOptions: { host: 'localhost' } })
await registry.prepare()
Options
RedisEngine
takes the same options as the redis client.
Additionally takes the following ones:
client
RedisClient
If you already have a client working in your app you can pass the instance here to not connect another client inside the instance.globalClient
String
If the redis client lives in a global variable, name it here.identifier
String
String to prepend for identifying the registry related keys.expireAfter
number
Time in seconds to expire the tokens after, default is never expire.
Typescript
This library is developed in TypeScript and shipped fully typed.
Contributing
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.