Chatness Widgets

Learn how to configure and use Chatness Widgets.

Launcher

Now it's time to embed Chatness Launcher into your projects. You can achieve this by adding the following code snippet to your website, right before the closing </head> tag.

<script>
  (function () {
    const script = document.createElement('script');
    script.src = 'https://cdn.chatness.app/embed.js?v={current_chatness_version}';
    script.async = true;
    document.head.appendChild(script);
    script.addEventListener('load', () =>
      window.Chatness.Launcher.open({
        url: 'https://{my_chatness_project}-launcher.web.app',
      })
    );
  })();
</script>

Messenger

If you ever need to open the messenger programatically, you can do it by calling the open method on the Messenger object.

<script>
  document.addEventListener('load', () => {
    document.getElementById('chat').addEventListener('click', () => {
      window.Chatness.Messenger.open();
    })
  })
</script>
<a id="chat">Talk to us!</a>