ExWapp - an unofficial WhatsApp Web client library for Elixir

Ciao everyone :waving_hand:

So, for a long time ExWapp was a private library. I was using it in different products built for my clients and agencies (I work as a freelancer in Italy).

I’m making it public now because it works really well together with Spectre and Spectre BEAM. Combined, they give u a pretty nice stack for building WhatsApp agents in Elixir.

I also built ExGram, which mirrors ExWapp’s public API but for Telegram. It follows the same client-oriented approach, so it works well w/ Spectre too.

For me, these libraries kinda complete the ecosystem I wanted for building messaging agents:

  • ExWapp for WhatsApp
  • ExGram for Telegram
  • Spectre + Spectre BEAM for the agent runtime

I’ll keep updating them to fix bugs and improve stability, but I’m not planning huge new features rn. My next project is a game built w/ Elixir, so I’ll probably spend the next 2–3 months focused mostly on that :slightly_smiling_face:

About ExWapp itself: this isn’t just a small experiment I decided to publish. I’ve tested it in real projects w/ many devices, multiple simultaneous sessions and sessions kept active for months.

It does what it needs to do, and imo it’s already very solid.

The public API is based on %ExWapp.Client{} and the ExWapp facade:

client =
  ExWapp.new(
    session_id: "account_1",
    store: {ExWapp.Store.Ets, path: "/var/lib/my_app/account_1.etf"},
    transport: ExWapp.Client.Transport.Session,
    events: MyApp.WhatsAppEvents
  )

{:ok, client} = ExWapp.connect(client)
{:ok, client, {:code, qr_code}} = ExWapp.pair(client)

{:ok, client, message_id} =
  ExWapp.send_message(client,
    to: "393XXXXXXXXX@s.whatsapp.net",
    text: "Hello from Elixir!"
  )

It supports pairing, messages, media, contacts, chats, local history, multi-session usage, Signal encryption, app-state sync, retries, telemetry and pluggable storage/events.

Links:

Feedback, issues and PRs are welcome. If u try it, let me know what u build w/ it!

One important note: ExWapp is unofficial and isn’t affiliated w/ WhatsApp or Meta. It uses WhatsApp’s private web protocol, so compatibility can change, and unofficial clients or unauthorized automation can cause account restrictions or bans. Use a dedicated number, don’t spam, respect opt-in rules and use it at your own risk.

6 Likes