wwebjs-redis
v0.1.1
Published
A Redis Storage plugin for whatsapp-web.js library
Maintainers
Readme
wwebjs-redis
################################################################################
# #
# db db .8888. dP 888888b 8888ba .8888. d8b db 888888b d8888P #
# 88 88 d8' `8b 88 88 88 `8b d8' `8b 88V8 88 88 88 #
# Y8 8P 88 88 88 a88aaa 88aa8P' 88 88 88 V8 88 88aaa 88 #
# `8b d8' 88 88 88 88 88 `8b 88 88 88 V888 88 88 #
# `8bd8' Y8. .8P 88 88 88 .88 Y8. .8P dP 88 V88 88 88 #
# YP `888P' 88888P 888888P 888888' `888P' 88 VP 8P 888888P 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).
