Manual integration helper for running a real WhatsApp Web session in IEx.
This module is intentionally side-effectful and focused on debugging:
- connect + pair (QR saved to disk)
- send messages
- list chats and groups
- read stored chat messages
- wait for new incoming messages from the running session
Summary
Functions
Returns stored messages for a specific chat JID.
Returns the locally stored call log for this session, newest first.
Returns currently known chats from local storage.
Returns currently known groups from local chat storage for this session.
Lists supervised session IDs and their PIDs.
Runs a live session flow (connect + pair if needed), then returns the session and currently known chats/groups.
Runs a supervised multi-session flow keyed by session_id.
Sends a text message to a user or group JID.
Stops a supervised session started with run_session/2.
Functions
@spec get_messages(pid(), String.t(), keyword()) :: [ExWapp.Chat.message()]
Returns stored messages for a specific chat JID.
@spec list_calls( pid(), keyword() ) :: [ExWapp.Call.t()]
Returns the locally stored call log for this session, newest first.
@spec list_chats(pid()) :: [ExWapp.Chat.chat()]
Returns currently known chats from local storage.
@spec list_groups(pid()) :: [ExWapp.Chat.chat()]
Returns currently known groups from local chat storage for this session.
Lists supervised session IDs and their PIDs.
Runs a live session flow (connect + pair if needed), then returns the session and currently known chats/groups.
Options:
:store_pathpersisted store path (default:/tmp/ex_wapp/live_test_session.etf):qr_pathQR svg output path (default:/tmp/whatsapp_qr.svg):pair_timeout_msQR pairing timeout (default:15000):connect_timeout_msconnect timeout (default:15000):sync_wait_mswait after connect before reading chats (default:15000):nameoptional GenServer name (default:ExWapp.Live.Session):replace_existingstop existing named session before start (default:true)
To run multiple sessions safely, use run_session/2.
Runs a supervised multi-session flow keyed by session_id.
This is the preferred way to run multiple sessions concurrently. Each session should use a unique store file to avoid stream conflicts.
Options:
:store_pathdefaults to/tmp/ex_wapp/sessions/<session_id>.etf:qr_pathdefaults to/tmp/ex_wapp/qr/<session_id>.svg:pair_timeout_msQR pairing timeout (default:15000):connect_timeout_msconnect timeout (default:15000):sync_wait_mswait after connect before reading chats (default:15000):replace_existingstop existing session with samesession_idbefore start (default:true)
Sends a text message to a user or group JID.
@spec stop_session(term()) :: :ok | {:error, :not_found}
Stops a supervised session started with run_session/2.