Web Chat API Reference

functions you can run on a running Web Chat.

Web Chat Window

Function

Description

IrisWebChat.setOpen()

Sets the state of the Webchat, params:

true

false

IrisWebChat.toggleOpen()

Toggles the state of the Webchat and returns the current (post-set) value.

IrisWebChat.getOpen()

Returns the state of the Webchat.

For Inline mode, "open" state is when the Get Started button has been pressed by an End User.

For Floating mode, "open" state is when the Webchat Window is visible.

Action Button Visibility

Function

Description

IrisWebChat.setActionButtonHidden()

Sets the Action Button state, params:

true

false

IrisWebChat.toggleActionButtonHidden()

Toggles the state of the Action Button and returns the current (post-set) value.

IrisWebChat.getActionButtonHidden()

Returns the state of the Action Button.

Profile

Function

Description

IrisWebChat.setProfileData()

IrisWebChat.getProfile()

Examples

<a id="contact_us">Contact Us</a>
<script>
IrisWebChat.init({
token: '<YOUR_TOKEN>',
actionButtonHidden: true,
closedAcrossPages: true,
}).then(instance => {
document.getElementById('contact_us').addEventListener('click', () => {
instance.setOpen(true);
});
});
</script>