Overview & Quick Start
Embed the Asterlio CRM chat widget on any website using a single script tag. Control it with window.postMessage and the global window.ASTERLIO_API.
Quick Start
Paste this before the closing </body>:
<$>
var ASTERLIO_API = ASTERLIO_API || {}, ASTERLIO_LoadStart = new Date();
(function(){
var s1=document.createElement('script'),s0=document.getElementsByTagName('script')[0];
s1.async=true;
s1.src='https://DOMAIN/api/asterlio-widget-loader/YOUR_CLIENT_ID';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
Optional: Manual init
You can also initialize manually after the script loads:
// after the script loads
window.ASTERLIO_API?.init('YOUR_CLIENT_ID')
What you can do
- Open, close, minimize, and unminimize the chat
- Show/hide the CTA hover label
- Listen for unread counts, error messages, and chat room ID
Requirements
- Replace
YOUR_CLIENT_IDandDOMAINin the snippet - Allow the widget origin (
https://DOMAIN) in your CSP if applicable