How to enable chat widget Smooch.io only in one view?

505 Views Asked by At

I recently implement this widget 'smooch' (http://docs.smooch.io/javascript/#welcome) to chat with the customer and help her in my website and is working great. But now I want to enable only in one view like a help tab. Any idea how can I do this?

The implementation I am using is the same as says in the docs of the widget. In my index.html I have this configuration:

<script src="https://cdn.smooch.io/smooch.min.js"></script>

<script>
    Smooch.init({appToken: 'my_app_token'});
</script>

This produce the chat is visible in every pages of the website.

1

There are 1 best solutions below

1
On

I found a simple a solution with this line in the javascript controller.

document.getElementById("sk-holder").style.visibility = "hidden";

And when I want to show it:

document.getElementById("sk-holder").style.visibility = "show";