# Chat Box Triggers

Adjust chat behaviour.

⛔  Legacy API

You are browsing legacy API. Current version you can find here.

# Open

Open chat box.

<script>
	smartsupp('chat:open');
</script>

Or use inside html:

<img onclick="smartsupp('chat:open');">
<a href="#" onclick="smartsupp('chat:open'); return false;">Chat with us</a>

# Close

Close chat box.

<script>
	smartsupp('chat:close');
</script>

# Message

Set pre-filled message in chat box (text is not sent).

<script>
	smartsupp('chat:message', 'Hello, can you help me with...');
</script>

# Avatar

Set logo inside chat box, which is displayed by default when no agent is connected.

<script>
	smartsupp('chat:avatar', 'URL_TO_IMAGE');
</script>

# Send

Send custom text in conversation in chat box. For example linked to button action.

<script>
	smartsupp('chat:send', 'Hello, can you help me with...');
</script>