Skip to main content

Advanced: chat box position via the JavaScript API

Control the chat box position in code, including different positions for desktop and mobile.

The Smartsupp JavaScript API gives developers precise control over where the chat widget appears on your website. This guide shows how to set the chat box position in code — including different positions for desktop and mobile.

Advanced: position via the JavaScript API

🟡 Note: Changing the position via API requires the PLUS package and developer access to your website's code.

The Smartsupp JavaScript API gives developers more precise control over the chat widget. For example, you can set different positions for desktop and mobile:

<script>
// Desktop position
smartsupp('chat:position', { bottom: 20, right: 20 });

// Mobile override
if (window.innerWidth < 768) {
  smartsupp('chat:position', { bottom: 100, right: 10 });
}
</script>

To implement it:

  1. Open your website's code and locate the Smartsupp installation script.

  2. Paste the snippet above directly below the Smartsupp script.

  3. Adjust the bottom and right values to suit your design for both desktop and mobile.

  4. Save your changes and refresh your website in an incognito or private window to verify the new positions.

💡 Tip: For full control, you can create your own button and manage the chat widget entirely through the JavaScript API.


What's next?

💡 Need more help? Contact our support team — we’re happy to assist!

Did this answer your question?