Chat Icon/Widget

Use Case

If you're on the Personal plan and do not currently have the ability to use "Display When" targeting, you can hide or show the Drift chat icon using these API Commands.

hide() and show()

api.widget.hide() hides the widget. shows the widget.


The example below shows how to the default state of the Chat Widget to hide. Only when the Window is wider than 780 does the widget show.

drift.on("ready", api => {
 if (window.innerWidth >= 780) {

Not using Drift yet? Get your free account here!

Chat Icon/Widget