WhatsBuddy
Chat on your site, controlled from the page
Paste one script. Open and close the window, fill the composer from a link, and hand the agent the page the visitor is on.
Your button
Hide the bubble and open the chat from a button you already have.
Prefilled links
A URL can fill the composer, open the window, or send the first line.
Page context
Tell the agent which room, plan, or page the visitor is looking at.
One script
The same widget.js tag is the embed and the JavaScript API.
Add the widget
Create a widget in the app, allow your hostname, and paste this on the page. Calls made before the script loads are queued.
<script>
window.WhatsBuddy = window.WhatsBuddy || function () {
(WhatsBuddy.q = WhatsBuddy.q || []).push(arguments);
};
WhatsBuddy('setContext', { plan: 'Pro' });
</script>
<script
src="https://whatsbuddy.com/widget.js"
data-key="WIDGET_PUBLIC_KEY"
async
></script>From your page
Open, fill, and tell it where they are
The script adds window.WhatsBuddy. One widget per page.
Open and close
WhatsBuddy.open(),close(), andtoggle(). The app can hide the Live Chat button. Your page then callsWhatsBuddy.open().Prefill or send
setMessage('Table for 2')fills the box.sendMessage('Table for 2')opens the window and sends it.Page context
setContext({ room: '12' })merges keys. The agent sees the snapshot when it changes, not on every message.
Links can start the chat
The widget reads these from your page URL. wbopen=0 stays closed even when the snippet says data-open="1".
https://hotel.example/rooms/12?wbmessage=Is%20Friday%20open%3F
https://hotel.example/rooms/12?wbmessage=Hold%20Friday&wbsend=1
https://hotel.example/contact?wbopen=1
https://hotel.example/pricing?wbmessage=Pro%20plan&wbopen=0The page URL, title, and referrer are sent with the chat unless you setdata-page-context="0". Custom fields stay in JavaScript, not in the query string. Operators see the current page on the website chat in Messenger.Create a widget
Put the chat where the question starts
The visitor stays on your site. You still read the thread in WhatsBuddy.