Send & Receive
Text, image, video, audio, document, sticker, location, contact, reactions, quoted replies, polls.
Send and receive WhatsApp messages from Ruby via a local Node.js bridge powered by Baileys. Includes Rails integration with multi-session support.
WARNING
This project uses WhatsApp Web's unofficial API via Baileys. It is not affiliated with or endorsed by WhatsApp/Meta. Your account may be banned. Do not use for spam.
require 'whatsapp'
client = Whatsapp.client
client.on_qr { |qr| puts qr }
client.on_message { |msg| puts "#{msg.from}: #{msg.text}" }
client.connect
client.send_message(to: "+33612345678", text: "Hello from Ruby!")class User < ApplicationRecord
has_whatsapp :phone
end
user.whatsapp.send_message("Your code is 1234")
user.whatsapp.send_image("receipt.jpg", caption: "Your invoice")class Hotel < ApplicationRecord
has_whatsapp :phone, account: true
end
hotel.whatsapp.connect
hotel.whatsapp.send_message(to: "+33612345678", text: "Bienvenue!")