mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-19 06:01:05 +08:00
Adds a WhatsApp chat channel backed by a QR-based web login flow so users can connect without manual token setup.
35 lines
764 B
Markdown
35 lines
764 B
Markdown
# RAGFlow WhatsApp Gateway
|
|
|
|
This directory contains a minimal WhatsApp gateway built on top of
|
|
`@whiskeysockets/baileys`.
|
|
|
|
## Install
|
|
|
|
```bash
|
|
cd api/channels/whatsapp/gateway-node
|
|
npm install
|
|
```
|
|
|
|
## Run
|
|
|
|
```bash
|
|
WHATSAPP_GATEWAY_PORT=3005 \
|
|
WHATSAPP_GATEWAY_DATA_DIR=~/.ragflow/whatsapp-gateway \
|
|
npm start
|
|
```
|
|
|
|
## API
|
|
|
|
- `POST /whatsapp/:sessionKey/start`
|
|
- `GET /whatsapp/:sessionKey/status`
|
|
- `GET /whatsapp/:sessionKey/events/ws?after=<seq>` (WebSocket)
|
|
- `POST /whatsapp/:sessionKey/send`
|
|
- `POST /whatsapp/:sessionKey/stop`
|
|
|
|
## Notes
|
|
|
|
- Authentication state is persisted under `WHATSAPP_GATEWAY_DATA_DIR`.
|
|
- Scan the QR code exposed in `status.qr_data_url`.
|
|
- RAGFlow polls `status` and `events` and forwards inbound messages to the
|
|
connected assistant.
|