1.2.8 • Published 3 years ago

@giovannilaperna/vue-tawk-multiple-languages v1.2.8

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

This is for private use since the chat widgets links are hardcoded in the repo.

Feel free to fork, change the chat ID and publish your own npm.

vue-tawk

wrapper of tawk

This Vue plugin injects a tawk.io instance into all of your vue instances

Install

npm install @giovannilaperna/vue-tawk-multiple-languages --save
or
yarn add @giovannilaperna/vue-tawk-multiple-languages -D

Usage

Initialize

First you'll need to register the plugin
Second you should have an account at https://www.tawk.to/ with multiple chat widgets for different languages. Then in your Nuxtjs project:

import Vue from 'vue'
import Tawk  from '@giovannilaperna/vue-tawk-multiple-languages'
  
Vue.use(Tawk)

Set the visitor name and email

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
}

Set a generic attribute

this.$Tawk.$setAttribute(attribute)
the object of attribute should like that
{
    key: 'value',
}

Ends the current ongoing chat.

this.$Tawk.$endChat()

Show the chat widget

this.$Tawk.$showWidget()

Hide the chat widget

this.$Tawk.$hideWidget()

Roggle the chat widget visibility

this.$Tawk.$toggleVisibility()
1.2.8

3 years ago

1.2.7

3 years ago