wrapper of tawk
This Vue plugin injects a tawk.io instance into all of your vue instances
npm install vue-tawk --save
or
yarn add vue-tawk -D
First you'll need to register the plugin
Second you should had a account of https://www.tawk.to/
import Tawk from 'vue-tawk'
Vue.use(Tawk, {
tawkSrc: 'YOU_TAWK_SRC'
})
The chat is not automatically started. To do that, you must execute this:
this.$Tawk.$startChat();
this.$Tawk.$updateChatUser(user)
the object of user should like that
{
name: 'user name',
email: 'user email',
hash: '' // see more https://www.tawk.to/javascript-api/#securemode
}
you should close the chat when user logout your website
this.$Tawk.$endChat()
you can toggle, hide and show widget with the following command:
this.$Tawk.$toggleVisibility()
this.$Tawk.$showWidget()
this.$Tawk.$hideWidget()
you can toggle, minimize and maximize the chat with the following command:
this.$Tawk.$toggle()
this.$Tawk.$maximize()
this.$Tawk.$minimize()
You can also open the chat in a pop-up this way:
this.$Tawk.$popup()