Skip to content

WhatsApp setup

WhatsApp connectivity relies on the unofficial Baileys library and may stop working following upstream protocol changes. Leviro Relay is not affiliated with Meta or WhatsApp.

  1. Open Session in the dashboard.
  2. Select Connect and wait for the QR code.
  3. On the phone, open WhatsApp → Linked devices → Link a device.
  4. Scan the QR code shown in the dashboard.
  5. Wait for the state to become Connected and for contact/group sync to complete.

WhatsApp session credentials are stored as encrypted Baileys auth records in MongoDB (AES-256-GCM under WA_SESSION_ENCRYPTION_KEY). They survive application and container restarts.

Use Refresh to request a fresh contacts/groups sync. Use Logout only when you intend to unlink the session; it deletes the stored credentials and the next connection requires a new QR code.

  • Reconnection retries with exponential backoff (5s, 10s, 20s … capped at 5 minutes) until the socket comes back or WhatsApp says the session was logged out — only that state needs a QR scan.
  • While contact/group sync is running (directorySyncing), the worker holds sends back; that is not a stuck queue.
  • Run one worker for a WhatsApp session. Two workers using the same MongoDB auth records can invalidate keys or repeatedly disconnect one another.

If the dashboard reports that the saved WhatsApp session cannot be read, the encryption key is wrong or was rotated (see Configuration). There is no recovery except logging out and pairing again.

  • Confirm the worker is running: docker compose ps.
  • Review docker compose logs --tail=200 worker.
  • Confirm MongoDB and Redis are healthy.
  • Select Logout only if the stored session is known to be invalid, then pair again.