wwebjs-redis
v0.2.0
Published
A Redis Storage plugin for whatsapp-web.js library
Maintainers
Readme
wwebjs-redis
########################################################################
# #
# db db .888. dP 88888b 888ba .888. d8b db 88888b d8888P #
# 88 88 d8' `8b 88 88 88 `8b d8' `8b 88V8 88 88 88 #
# Y8 8P 88 88 88 88aa 88a8P' 88 88 88 VL88 88aa 88 #
# `8b d8' 88 88 88 88 88 `8b 88 88 88 V88 88 88 #
# `8V8' Y8. .8P 88 88 88 .88 Y8. .8P dP 88 `88 88 88 #
# `Y' `88P' 8888P 88888P 88888' `88P' 88 VP 8P 88888P dP #
# #
########################################################################A Redis Storage plugin for whatsapp-web.js library. Use RedisStore to save
your WhatsApp session in a Redis DB.
Usage
Install:
npm install -S wwebjs-redis @redis/clientAnd in your code:
import { Client, RemoteAuth } from 'whatsapp-web.js'
import { RedisStore } from 'wwebjs-redis'
import { createClient } from '@redis/client'
async function startApp () {
const redisClient = createClient({
url: process.env.TESTS_REDIS_URL,
})
await redisClient.connect()
const redisStore = new RedisStore({
redis: redisClient,
keyPrefix: 'prefix:for:key:in:redis:',
})
const waClient = new Client({
authStrategy: new RemoteAuth({
store: redisStore,
})
})
await client.initialize()
}See Also
TODO
- [ ] check documentation (especially the code sample)
- [ ] add
src/redis-store.d.ts - [ ] add docs for connecting to Redis with
connectionStringinstead of Client - [ ] fix Snyk integration
- [ ] remove
@volebo/devkitdependency (or wait for it to become public and fix Pipeline testing)
Contributing
You could take part in the development process, just follow this Contributing guideline.
License
Please, read the LICENSE file in the root of the repository
(or downloaded package).
