Skip to content

Methods (JavaScript API)

Interact with your chat widget and tell what you want it to do.

Method nameDescription
toggleToggle (open/close) chat popup.
openOpen chat popup and redirect to a page.

TIP

It is OK to run scxi() function anywhere in your website. The widget remembers early user-actions and run them once the widget is fully loaded.

scxi('toggle')

Simply toggle (open/close) popup.

html
<script>
  // toggle chat popup (immediately)
  scxi('toggle');
</script>

<!-- toggle chat popup with a link click -->
<button onclick="scxi('toggle')">Chat with us</button>

scxi('open')

Open chat popup. Optionally, you can also redirect to a page inside chat widget at the same time.

js
// simply open chat popup
scxi('open');

Open popup and redirect to a page

js
// go to "chats" page after open
scxi('open', { page: 'chats' }); 

// ensure you start with home page
scxi('open', { page: 'home' });