Trigger Boei to open from any button or element on your website.
How to get there: Go to Setup → Widget in the top menu → click your widget → copy the embed code, then use the CSS class on your website.
Boei listens for clicks on any element with the class boei-embed-open. Add this class to any button, link, or element to make it open your widget.
<a href="#" class="boei-embed-open">Click here to contact us</a>
<a class="boei-embed-open">Get in touch</a>
<button class="boei-embed-open">Need help?</button>
<button class="boei-embed-open my-custom-button">Chat with us</button>
Add a data-channel attribute with the channel key (you can copy this from the channel settings inside your widget) to open straight into that channel:
<a class="boei-embed-open" data-channel="whatsapp">WhatsApp us</a>
You can also open the widget by adding ?open-chat=1 (or ?open-chat=true) to any page URL on your site. When a visitor lands on that URL, the widget opens automatically.
This is useful for:
https://yoursite.com/?open-chat=1
https://yoursite.com/pricing?open-chat=true
https://yoursite.com/contact?open-chat=1#plans
The parameter works alongside other query strings and URL anchors.
If you need to open the widget from your own JavaScript (after a form submit, a search query, an analytics event, etc.), call the global Boei.* methods:
<script>
Boei.open(); // open the widget
Boei.open('whatsapp'); // open straight into a channel
Boei.close(); // close the panel
Boei.isOpen(); // returns true / false
Boei.hideLauncher(); // hide the launcher button entirely
Boei.showLauncher(); // show it again
Boei.ask('How do I install?'); // open the chatbot and auto-send a first message
</script>
See the Boei SDK Guide for full details and the advanced callback form.