From 63c66e04cb14964a8b40901a65f660008ea38f64 Mon Sep 17 00:00:00 2001 From: Jerald Austero Date: Tue, 24 Sep 2024 12:23:19 +0800 Subject: [PATCH 1/2] Rename provider keys to avoid colission --- src/lib/index.js | 92 ++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/src/lib/index.js b/src/lib/index.js index c5d85a2..f3dc2cb 100644 --- a/src/lib/index.js +++ b/src/lib/index.js @@ -70,43 +70,43 @@ class TawkMessenger { * API for calling an action on the widget */ provideActions() { - this.app.provide('start', () => { + this.app.provide('tawkStart', () => { window.Tawk_API.start(); }); - this.app.provide('shutdown', () => { + this.app.provide('tawkShutdown', () => { window.Tawk_API.shutdown(); }); - this.app.provide('maximize', () => { + this.app.provide('tawkMaximize', () => { window.Tawk_API.maximize(); }); - this.app.provide('minimize', () => { + this.app.provide('tawkMinimize', () => { window.Tawk_API.minimize(); }); - this.app.provide('toggle', () => { + this.app.provide('tawkToggle', () => { window.Tawk_API.toggle(); }); - this.app.provide('popup', () => { + this.app.provide('tawkPopup', () => { window.Tawk_API.popup(); }); - this.app.provide('showWidget', () => { + this.app.provide('tawkShowWidget', () => { window.Tawk_API.showWidget(); }); - this.app.provide('hideWidget', () => { + this.app.provide('tawkHideWidget', () => { window.Tawk_API.hideWidget(); }); - this.app.provide('toggleVisibility', () => { + this.app.provide('tawkToggleVisibility', () => { window.Tawk_API.toggleVisibility(); }); - this.app.provide('endChat', () => { + this.app.provide('tawkEndChat', () => { window.Tawk_API.endChat(); }); } @@ -115,43 +115,43 @@ class TawkMessenger { * API for returning a data */ provideGetters() { - this.app.provide('getWindowType', () => { + this.app.provide('tawkGetWindowType', () => { return window.Tawk_API.getWindowType(); }); - this.app.provide('getStatus', () => { + this.app.provide('tawkGetStatus', () => { return window.Tawk_API.getStatus(); }); - this.app.provide('isChatMaximized', () => { + this.app.provide('tawkIsChatMaximized', () => { return window.Tawk_API.isChatMaximized(); }); - this.app.provide('isChatMinimized', () => { + this.app.provide('tawkIsChatMinimized', () => { return window.Tawk_API.isChatMinimized(); }); - this.app.provide('isChatHidden', () => { + this.app.provide('tawkIsChatHidden', () => { return window.Tawk_API.isChatHidden(); }); - this.app.provide('isChatOngoing', () => { + this.app.provide('tawkIsChatOngoing', () => { return window.Tawk_API.isChatOngoing(); }); - this.app.provide('isVisitorEngaged', () => { + this.app.provide('tawkIsVisitorEngaged', () => { return window.Tawk_API.isVisitorEngaged(); }); - this.app.provide('onLoaded', () => { + this.app.provide('tawkOnLoaded', () => { return window.Tawk_API.onLoaded; }); - this.app.provide('onBeforeLoaded', () => { + this.app.provide('tawkOnBeforeLoaded', () => { return window.Tawk_API.onBeforeLoaded; }); - this.app.provide('widgetPosition', () => { + this.app.provide('tawkWidgetPosition', () => { return window.Tawk_API.widgetPosition(); }); } @@ -161,121 +161,121 @@ class TawkMessenger { * inside of the widget */ provideListeners() { - this.app.provide('onLoad', (callback) => { + this.app.provide('tawkOnLoad', (callback) => { window.addEventListener('tawkLoad', () => { callback(); }); }); - this.app.provide('onStatusChange', (callback) => { + this.app.provide('tawkOnStatusChange', (callback) => { window.addEventListener('tawkStatusChange', (status) => { callback(status.detail); }); }); - this.app.provide('onBeforeLoad', (callback) => { + this.app.provide('tawkOnBeforeLoad', (callback) => { window.addEventListener('tawkBeforeLoad', () => { callback(); }); }); - this.app.provide('onChatMaximized', (callback) => { + this.app.provide('tawkOnChatMaximized', (callback) => { window.addEventListener('tawkChatMaximized', () => { callback(); }); }); - this.app.provide('onChatMinimized', (callback) => { + this.app.provide('tawkOnChatMinimized', (callback) => { window.addEventListener('tawkChatMinimized', () => { callback(); }); }); - this.app.provide('onChatHidden', (callback) => { + this.app.provide('tawkOnChatHidden', (callback) => { window.addEventListener('tawkChatHidden', () => { callback(); }); }); - this.app.provide('onChatStarted', (callback) => { + this.app.provide('tawkOnChatStarted', (callback) => { window.addEventListener('tawkChatStarted', () => { callback(); }); }); - this.app.provide('onChatEnded', (callback) => { + this.app.provide('tawkOnChatEnded', (callback) => { window.addEventListener('tawkChatEnded', () => { callback(); }); }); - this.app.provide('onPrechatSubmit', (callback) => { + this.app.provide('tawkOnPrechatSubmit', (callback) => { window.addEventListener('tawkPrechatSubmit', (data) => { callback(data.detail); }); }); - this.app.provide('onOfflineSubmit', (callback) => { + this.app.provide('tawkOnOfflineSubmit', (callback) => { window.addEventListener('tawkOfflineSubmit', (data) => { callback(data.detail); }); }); - this.app.provide('onChatMessageVisitor', (callback) => { + this.app.provide('tawkOnChatMessageVisitor', (callback) => { window.addEventListener('tawkChatMessageVisitor', (message) => { callback(message.detail); }); }); - this.app.provide('onChatMessageAgent', (callback) => { + this.app.provide('tawkOnChatMessageAgent', (callback) => { window.addEventListener('tawkChatMessageAgent', (message) => { callback(message.detail); }); }); - this.app.provide('onChatMessageSystem', (callback) => { + this.app.provide('tawkOnChatMessageSystem', (callback) => { window.addEventListener('tawkChatMessageSystem', (message) => { callback(message.detail); }); }); - this.app.provide('onAgentJoinChat', (callback) => { + this.app.provide('tawkOnAgentJoinChat', (callback) => { window.addEventListener('tawkAgentJoinChat', (data) => { callback(data.detail); }); }); - this.app.provide('onAgentLeaveChat', (callback) => { + this.app.provide('tawkOnAgentLeaveChat', (callback) => { window.addEventListener('tawkAgentLeaveChat', (data) => { callback(data.detail); }); }); - this.app.provide('onChatSatisfaction', (callback) => { + this.app.provide('tawkOnChatSatisfaction', (callback) => { window.addEventListener('tawkChatSatisfaction', (satisfaction) => { callback(satisfaction.detail); }); }); - this.app.provide('onVisitorNameChanged', (callback) => { + this.app.provide('tawkOnVisitorNameChanged', (callback) => { window.addEventListener('tawkVisitorNameChanged', (visitorName) => { callback(visitorName.detail); }); }); - this.app.provide('onFileUpload', (callback) => { + this.app.provide('tawkOnFileUpload', (callback) => { window.addEventListener('tawkFileUpload', (link) => { callback(link.detail); }); }); - this.app.provide('onTagsUpdated', (callback) => { + this.app.provide('tawkOnTagsUpdated', (callback) => { window.addEventListener('tawkTagsUpdated', (data) => { callback(data.detail); }); }); - this.app.provide('onUnreadCountChanged', (callback) => { + this.app.provide('tawkOnUnreadCountChanged', (callback) => { window.addEventListener('tawkUnreadCountChanged', (data) => { callback(data.detail); }); @@ -286,27 +286,27 @@ class TawkMessenger { * API for setting a data on the widget */ provideSetters() { - this.app.provide('visitor', (data) => { + this.app.provide('tawkVisitor', (data) => { window.Tawk_API.visitor = data; }); - this.app.provide('setAttributes', (attribute, callback) => { + this.app.provide('tawkSetAttributes', (attribute, callback) => { window.Tawk_API.setAttributes(attribute, callback); }); - this.app.provide('addEvent', (event, metadata, callback) => { + this.app.provide('tawkAddEvent', (event, metadata, callback) => { window.Tawk_API.addEvent(event, metadata, callback); }); - this.app.provide('addTags', (tags, callback) => { + this.app.provide('tawkAddTags', (tags, callback) => { window.Tawk_API.addTags(tags, callback); }); - this.app.provide('removeTags', (tags, callback) => { + this.app.provide('tawkRemoveTags', (tags, callback) => { window.Tawk_API.removeTags(tags, callback); }); - this.app.provide('switchWidget', (data, callback) => { + this.app.provide('tawkSwitchWidget', (data, callback) => { window.Tawk_API.switchWidget(data, callback); }); } From 49432a0e211a65850ac54e18bd4a9377ccd46f55 Mon Sep 17 00:00:00 2001 From: Jerald Austero Date: Tue, 24 Sep 2024 16:47:12 +0800 Subject: [PATCH 2/2] Update documentation base on new prefix --- docs/api-reference.md | 680 +++++++++++++++++++++--------------------- docs/spa-setup.md | 4 +- docs/ssr-setup.md | 10 +- 3 files changed, 346 insertions(+), 348 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 4fa4922..3f8a4f8 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -11,70 +11,70 @@ Use the JavaScript API to manipulate the chat widget displayed on your website. ## Table of contents - [API Reference](#api-reference) - [Table of contents](#table-of-contents) - - [onLoad](#onload) - - [onStatusChange](#onstatuschange) - - [onBeforeLoad](#onbeforeload) - - [onChatMaximized](#onchatmaximized) - - [onChatMinimized](#onchatminimized) - - [onChatHidden](#onchathidden) - - [onChatStarted](#onchatstarted) - - [onChatEnded](#onchatended) - - [onPrechatSubmit](#onprechatsubmit) - - [onOfflineSubmit](#onofflinesubmit) - - [onChatMessageVisitor](#onchatmessagevisitor) - - [onChatMessageAgent](#onchatmessageagent) - - [onChatMessageSystem](#onchatmessagesystem) - - [onAgentJoinChat](#onagentjoinchat) - - [onAgentLeaveChat](#onagentleavechat) - - [onChatSatisfaction](#onchatsatisfaction) - - [onVisitorNameChanged](#onvisitornamechanged) - - [onFileUpload](#onfileupload) - - [onTagsUpdated](#ontagsupdated) - - [onUnreadCountChanged](#onunreadcountchanged) - - [visitor](#visitor) + - [tawkOnLoad](#tawkonload) + - [tawkOnStatusChange](#tawkonstatuschange) + - [tawkOnBeforeLoad](#tawkonbeforeload) + - [tawkOnChatMaximized](#tawkonchatmaximized) + - [tawkOnChatMinimized](#tawkonchatminimized) + - [tawkOnChatHidden](#tawkonchathidden) + - [tawkOnChatStarted](#tawkonchatstarted) + - [tawkOnChatEnded](#tawkonchatended) + - [tawkOnPrechatSubmit](#tawkonprechatsubmit) + - [tawkOnOfflineSubmit](#tawkonofflinesubmit) + - [tawkOnChatMessageVisitor](#tawkonchatmessagevisitor) + - [tawkOnChatMessageAgent](#tawkonchatmessageagent) + - [tawkOnChatMessageSystem](#tawkonchatmessagesystem) + - [tawkOnAgentJoinChat](#tawkonagentjoinchat) + - [tawkOnAgentLeaveChat](#tawkonagentleavechat) + - [tawkOnChatSatisfaction](#tawkonchatsatisfaction) + - [tawkOnVisitorNameChanged](#tawkonvisitornamechanged) + - [tawkOnFileUpload](#tawkonfileupload) + - [tawkOnTagsUpdated](#tawkontagsupdated) + - [tawkOnUnreadCountChanged](#tawkonunreadcountchanged) + - [tawkVisitor](#tawkvisitor) - [autoStart](#autostart) - [start](#start) - - [shutdown](#shutdown) - - [maximize](#maximize) - - [minimize](#minimize) - - [toggle](#toggle) - - [popup](#popup) - - [getWindowType](#getwindowtype) - - [showWidget](#showwidget) - - [hideWidget](#hidewidget) - - [toggleVisibility](#togglevisibility) - - [getStatus](#getstatus) - - [isChatMaximized](#ischatmaximized) - - [isChatMinimized](#ischatminimized) - - [isChatHidden](#ischathidden) - - [isChatOngoing](#ischatongoing) - - [isVisitorEngaged](#isvisitorengaged) - - [onLoaded](#onloaded) - - [onBeforeLoaded](#onbeforeloaded) - - [widgetPosition](#widgetposition) - - [endChat](#endchat) - - [setAttributes](#setattributes) - - [addEvent](#addevent) - - [addTags](#addtags) - - [removeTags](#removetags) + - [tawkShutdown](#tawkshutdown) + - [tawkMaximize](#tawkmaximize) + - [tawkMinimize](#tawkminimize) + - [tawkToggle](#tawktoggle) + - [tawkPopup](#tawkpopup) + - [tawkGetWindowType](#tawkgetwindowtype) + - [tawkShowWidget](#tawkshowwidget) + - [tawkHideWidget](#tawkhidewidget) + - [tawkToggleVisibility](#tawktogglevisibility) + - [tawkGetStatus](#tawkgetstatus) + - [tawkIsChatMaximized](#tawkischatmaximized) + - [tawkIsChatMinimized](#tawkischatminimized) + - [tawkIsChatHidden](#tawkischathidden) + - [tawkIsChatOngoing](#tawkischatongoing) + - [tawkIsVisitorEngaged](#tawkisvisitorengaged) + - [tawkOnLoaded](#tawkonloaded) + - [tawkOnBeforeLoaded](#tawkonbeforeloaded) + - [tawkWidgetPosition](#tawkwidgetposition) + - [tawkEndChat](#tawkendchat) + - [tawkSetAttributes](#tawksetattributes) + - [tawkAddEvent](#tawkaddevent) + - [tawkAddTags](#tawkaddtags) + - [tawkRemoveTags](#tawkremovetags) - [secureMode](#securemode) - [customstyle](#customstyle) - [zIndex](#zindex) - [Visibility](#visibility) - - [switchWidget](#switchwidget) + - [tawkSwitchWidget](#tawkswitchwidget)
-## onLoad +## tawkOnLoad Callback function invoked right after the widget is rendered. This callback is not supported in pop out chat window. `Composition API` ```html @@ -83,10 +83,10 @@ pop out chat window. `Options API` ```js export default { - inject : ['onLoad'], + inject : ['tawkOnLoad'], mounted() { - this.onLoad(() => { + this.tawkOnLoad(() => { // place your code here }); } @@ -95,15 +95,15 @@ export default {
-## onStatusChange +## tawkOnStatusChange Callback function invoked when the page status changes. The function will receive the changed status which will be either online, away or offline. This callback is not supported in pop out chat window. `Composition API` ```html @@ -112,10 +112,10 @@ Callback function invoked when the page status changes. The function will receiv `Options API` ```js export default { - inject : ['onStatusChange'], + inject : ['tawkOnStatusChange'], mounted() { - this.onStatusChange((status) => { + this.tawkOnStatusChange((status) => { // place your code here }); } @@ -124,15 +124,15 @@ export default {
-## onBeforeLoad +## tawkOnBeforeLoad Callback function invoked right when Tawk_API is ready to be used and before the widget is rendered. This callback is not supported in pop out chat window. `Composition API` ```html @@ -141,10 +141,10 @@ Callback function invoked right when Tawk_API is ready to be used and before the `Options API` ```js export default { - inject : ['onBeforeLoad'], + inject : ['tawkOnBeforeLoad'], mounted() { - this.onBeforeLoad(() => { + this.tawkOnBeforeLoad(() => { // place your code here }); } @@ -153,15 +153,15 @@ export default {
-## onChatMaximized +## tawkOnChatMaximized Callback function invoked when the widget is maximized. This callback is not supported in pop out chat window. `Composition API` ```html @@ -170,10 +170,10 @@ Callback function invoked when the widget is maximized. This callback is not sup `Options API` ```js export default { - inject : ['onChatMaximized'], + inject : ['tawkOnChatMaximized'], mounted() { - this.onChatMaximized(() => { + this.tawkOnChatMaximized(() => { // place your code here }); } @@ -182,15 +182,15 @@ export default {
-## onChatMinimized +## tawkOnChatMinimized Callback function invoked when the widget is minimized. This callback is not supported in pop out chat window. `Composition API` ```html @@ -199,10 +199,10 @@ Callback function invoked when the widget is minimized. This callback is not sup `Options API` ```js export default { - inject : ['onChatMinimized'], + inject : ['tawkOnChatMinimized'], mounted() { - this.onChatMinimized(() => { + this.tawkOnChatMinimized(() => { // place your code here }); } @@ -211,15 +211,15 @@ export default {
-## onChatHidden +## tawkOnChatHidden Callback function invoked when the widget is hidden. This callback is not supported in pop out chat window. `Composition API` ```html @@ -228,10 +228,10 @@ Callback function invoked when the widget is hidden. This callback is not suppor `Options API` ```js export default { - inject : ['onChatHidden'], + inject : ['tawkOnChatHidden'], mounted() { - this.onChatHidden(() => { + this.tawkOnChatHidden(() => { // place your code here }); } @@ -240,15 +240,15 @@ export default {
-## onChatStarted +## tawkOnChatStarted Callback function invoked when the widget is started. `Composition API` ```html @@ -257,10 +257,10 @@ Callback function invoked when the widget is started. `Options API` ```js export default { - inject : ['onChatStarted'], + inject : ['tawkOnChatStarted'], mounted() { - this.onChatStarted(() => { + this.tawkOnChatStarted(() => { // place your code here }); } @@ -269,15 +269,15 @@ export default {
-## onChatEnded +## tawkOnChatEnded Callback function invoked when the widget is ended. This callback is not supported in pop out chat window. `Composition API` ```html @@ -286,10 +286,10 @@ Callback function invoked when the widget is ended. This callback is not support `Options API` ```js export default { - inject : ['onChatEnded'], + inject : ['tawkOnChatEnded'], mounted() { - this.onChatEnded(() => { + this.tawkOnChatEnded(() => { // place your code here }); } @@ -298,15 +298,15 @@ export default {
-## onPrechatSubmit +## tawkOnPrechatSubmit Callback function invoked when the Pre-Chat Form is submitted. The submitted form data is passed to the function. This callback is not supported in pop out chat window. `Composition API` ```html @@ -315,10 +315,10 @@ Callback function invoked when the Pre-Chat Form is submitted. The submitted for `Options API` ```js export default { - inject : ['onPrechatSubmit'], + inject : ['tawkOnPrechatSubmit'], mounted() { - this.onPrechatSubmit((data) => { + this.tawkOnPrechatSubmit((data) => { // place your code here }); } @@ -327,15 +327,15 @@ export default {
-## onOfflineSubmit +## tawkOnOfflineSubmit Callback function invoked when the Offline form is submitted. The submitted form data is passed to the function. Form data will contain {name : ”, email : ”, message : ”, questions : []}. This callback is not supported in pop out chat window. `Composition API` ```html @@ -344,10 +344,10 @@ Callback function invoked when the Offline form is submitted. The submitted form `Options API` ```js export default { - inject : ['onOfflineSubmit'], + inject : ['tawkOnOfflineSubmit'], mounted() { - this.onOfflineSubmit((data => { + this.tawkOnOfflineSubmit((data => { // place your code here }); } @@ -356,15 +356,15 @@ export default {
-## onChatMessageVisitor +## tawkOnChatMessageVisitor Callback function invoked when message is sent by the visitor. The message is passed to the function. This callback is not supported in pop out chat window. `Composition API` ```html @@ -373,10 +373,10 @@ Callback function invoked when message is sent by the visitor. The message is pa `Options API` ```js export default { - inject : ['onChatMessageVisitor'], + inject : ['tawkOnChatMessageVisitor'], mounted() { - this.onChatMessageVisitor((message) => { + this.tawkOnChatMessageVisitor((message) => { // place your code here }); } @@ -385,15 +385,15 @@ export default {
-## onChatMessageAgent +## tawkOnChatMessageAgent Callback function invoked when message is sent by the agent. The message is passed to the function. This callback is not supported in pop out chat window. `Composition API` ```html @@ -402,10 +402,10 @@ Callback function invoked when message is sent by the agent. The message is pass `Options API` ```js export default { - inject : ['onChatMessageeAgent'], + inject : ['tawkOnChatMessageAgent'], mounted() { - this.onChatMessageeAgent((message) => { + this.tawkOnChatMessageAgent((message) => { // place your code here }); } @@ -414,15 +414,15 @@ export default {
-## onChatMessageSystem +## tawkOnChatMessageSystem Callback function invoked when message is sent by the system. The message is passed to the function. This callback is not supported in pop out chat window. `Composition API` ```html @@ -431,10 +431,10 @@ Callback function invoked when message is sent by the system. The message is pas `Options API` ```js export default { - inject : ['onChatMessageSystem'], + inject : ['tawkOnChatMessageSystem'], mounted() { - this.onChatMessageSystem((message) => { + this.tawkOnChatMessageSystem((message) => { // place your code here }); } @@ -443,15 +443,15 @@ export default {
-## onAgentJoinChat +## tawkOnAgentJoinChat Callback function invoked when an agent joins the chat. The data is passed to the function. Will contain {name : ”, position : ”, image : ”, id : ”}. This callback is not supported in pop out chat window. `Composition API` ```html @@ -460,10 +460,10 @@ Callback function invoked when an agent joins the chat. The data is passed to th `Options API` ```js export default { - inject : ['onAgentJoinChat'], + inject : ['tawkOnAgentJoinChat'], mounted() { - this.onAgentJoinChat((data) => { + this.tawkOnAgentJoinChat((data) => { // place your code here }); } @@ -472,15 +472,15 @@ export default {
-## onAgentLeaveChat +## tawkOnAgentLeaveChat Callback function invoked when an agent leaves the chat. The data is passed to the function. Will contain {name : ”, id : ”}. This callback is not supported in pop out chat window. `Composition API` ```html @@ -489,10 +489,10 @@ Callback function invoked when an agent leaves the chat. The data is passed to t `Options API` ```js export default { - inject : ['onAgentLeaveChat'], + inject : ['tawkOnAgentLeaveChat'], mounted() { - this.onAgentLeaveChat((data) => { + this.tawkOnAgentLeaveChat((data) => { // place your code here }); } @@ -501,15 +501,15 @@ export default {
-## onChatSatisfaction +## tawkOnChatSatisfaction Callback function invoked when an agent leaves the chat. The satisfaction is passed to the function. -1 = dislike | 0 = neutral | 1 = like. This callback is not supported in pop out chat window. `Composition API` ```html @@ -518,10 +518,10 @@ Callback function invoked when an agent leaves the chat. The satisfaction is pas `Options API` ```js export default { - inject : ['onChatSatisfaction'], + inject : ['tawkOnChatSatisfaction'], mounted() { - this.onChatSatisfaction((satisfaction) => { + this.tawkOnChatSatisfaction((satisfaction) => { // place your code here }); } @@ -530,15 +530,15 @@ export default {
-## onVisitorNameChanged +## tawkOnVisitorNameChanged Callback function invoked when the visitor manually changes his name. The visitorName is passed to the function. This callback is not supported in pop out chat window. `Composition API` ```html @@ -547,10 +547,10 @@ Callback function invoked when the visitor manually changes his name. The visito `Options API` ```js export default { - inject : ['onVisitorNameChanged'], + inject : ['tawkOnVisitorNameChanged'], mounted() { - this.onVisitorNameChanged((visitorName) => { + this.tawkOnVisitorNameChanged((visitorName) => { // place your code here }); } @@ -559,15 +559,15 @@ export default {
-## onFileUpload +## tawkOnFileUpload Callback function invoked when a file is uploaded. The link to the uploaded file is passed to the function. This callback is not supported in pop out chat window. `Composition API` ```html @@ -576,10 +576,10 @@ Callback function invoked when a file is uploaded. The link to the uploaded file `Options API` ```js export default { - inject : ['onFileUpload'], + inject : ['tawkOnFileUpload'], mounted() { - this.onFileUpload((link) => { + this.tawkOnFileUpload((link) => { // place your code here }); } @@ -588,15 +588,15 @@ export default {
-## onTagsUpdated +## tawkOnTagsUpdated Callback function invoked when a tag is updated. `Composition API` ```html @@ -605,10 +605,10 @@ Callback function invoked when a tag is updated. `Options API` ```js export default { - inject : ['onTagsUpdated'], + inject : ['tawkOnTagsUpdated'], mounted() { - this.onTagsUpdated((data) => { + this.tawkOnTagsUpdated((data) => { // place your code here }); } @@ -617,15 +617,15 @@ export default {
-## onUnreadCountChanged +## tawkOnUnreadCountChanged Callback function returns count of unread messages. `Composition API` ```html @@ -634,10 +634,10 @@ Callback function returns count of unread messages. `Options API` ```js export default { - inject : ['onUnreadCountChanged'], + inject : ['tawkOnUnreadCountChanged'], mounted() { - this.onUnreadCountChanged((count) => { + this.tawkOnUnreadCountChanged((count) => { // place your code here }); } @@ -646,7 +646,7 @@ export default {
-## visitor +## tawkVisitor Object used to set the visitor name and email. Do not place this object in a function, as the values need to be available before the widget script is downloaded. Setting or changing the values after the widget script has been downloaded will not send the values to the dashboard. @@ -656,9 +656,9 @@ If the name and email will not be available on load time (eg single page app, aj `Composition API` ```html @@ -714,53 +713,52 @@ Start the tawk socket connection. `Options API` ```js export default { - inject : ['start', 'onLoad'], + inject : ['tawkStart'], mounted() { - this.start(); + this.tawkStart(); } } ```
-## shutdown +## tawkShutdown End the tawk socket connection. `Composition API` ```html ``` `Options API` ```js export default { - inject : ['shutdown', 'onLoad'], + inject : ['tawkShutdown'], mounted() { - this.shutdown(); + this.tawkShutdown(); } } ```
-## maximize +## tawkMaximize Maximizes the chat widget. `Composition API` ```html ``` @@ -768,11 +766,11 @@ Maximizes the chat widget. `Options API` ```js export default { - inject : ['maximize', 'onLoad'], + inject : ['tawkMaximize', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.maximize(); + this.tawkOnLoad(() => { + this.tawkMaximize(); }); } } @@ -780,17 +778,17 @@ export default {
-## minimize +## tawkMinimize Minimizes the chat widget. `Composition API` ```html ``` @@ -798,11 +796,11 @@ Minimizes the chat widget. `Options API` ```js export default { - inject : ['minimize', 'onLoad'], + inject : ['tawkMinimize', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.minimize(); + this.tawkOnLoad(() => { + this.tawkMinimize(); }); } } @@ -810,17 +808,17 @@ export default {
-## toggle +## tawkToggle Minimizes or Maximizes the chat widget based on the current state. `Composition API` ```html ``` @@ -828,11 +826,11 @@ Minimizes or Maximizes the chat widget based on the current state. `Options API` ```js export default { - inject : ['toggle', 'onLoad'], + inject : ['tawkToggle', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.toggle(); + this.tawkOnLoad(() => { + this.tawkToggle(); }); } } @@ -840,17 +838,17 @@ export default {
-## popup +## tawkPopup Opens the chat widget as a pop out. `Composition API` ```html ``` @@ -858,11 +856,11 @@ Opens the chat widget as a pop out. `Options API` ```js export default { - inject : ['popup', 'onLoad'], + inject : ['tawkPopup', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.popup(); + this.tawkOnLoad(() => { + this.tawkPopup(); }); } } @@ -870,17 +868,17 @@ export default {
-## getWindowType +## tawkGetWindowType Returns the current widget type whether it’s inline or embed. `Composition API` ```html ``` @@ -926,11 +924,11 @@ Shows the chat widget. `Options API` ```js export default { - inject : ['showWidget', 'onLoad'], + inject : ['tawkShowWidget', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.showWidget(); + this.tawkOnLoad(() => { + this.tawkShowWidget(); }); } } @@ -938,17 +936,17 @@ export default {
-## hideWidget +## tawkHideWidget Hide the chat widget. `Composition API` ```html ``` @@ -956,11 +954,11 @@ Hide the chat widget. `Options API` ```js export default { - inject : ['hideWidget', 'onLoad'], + inject : ['tawkHideWidget', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.hideWidget(); + this.tawkOnLoad(() => { + this.tawkHideWidget(); }); } } @@ -968,17 +966,17 @@ export default {
-## toggleVisibility +## tawkToggleVisibility Hides or Shows the chat widget based on the current visibility state. `Composition API` ```html ``` @@ -986,11 +984,11 @@ Hides or Shows the chat widget based on the current visibility state. `Options API` ```js export default { - inject : ['toggleVisibility', 'onLoad'], + inject : ['tawkToggleVisibility', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.toggleVisibility(); + this.tawkOnLoad(() => { + this.tawkToggleVisibility(); }); } } @@ -998,19 +996,19 @@ export default {
-## getStatus +## tawkGetStatus Returns the current page status (online, away or offline). `Composition API` ```html @@ -1227,25 +1225,25 @@ Returns a boolean value (true or undefined) indicating when the plugin is ready. `Options API` ```js export default { - inject : ['onLoaded'], + inject : ['tawkOnLoaded'], mounted() { - if(this.onLoaded()) { + if(this.tawkOnLoaded()) { // do something when widget is loaded } } } ``` -## onBeforeLoaded +## tawkOnBeforeLoaded Returns a boolean value (true or undefined) indicating when plugin is initialize. `Composition API` ```html @@ -1254,27 +1252,27 @@ Returns a boolean value (true or undefined) indicating when plugin is initialize `Options API` ```js export default { - inject : ['onBeforeLoaded'], + inject : ['tawkOnBeforeLoaded'], mounted() { - if(this.onBeforeLoaded()) { + if(this.tawkOnBeforeLoaded()) { // do something before onload } } } ``` -## widgetPosition +## tawkWidgetPosition Returns a string for current position of the widget. `Composition API` ```html ``` @@ -1316,11 +1314,11 @@ Ends the current ongoing chat. `Options API` ```js export default { - inject : ['endChat', 'onLoad'], + inject : ['tawkEndChat', 'tawkOnLoad'], mounted() { - this.onLoad(() => { - this.endChat(); + this.tawkOnLoad(() => { + this.tawkEndChat(); }); } } @@ -1329,7 +1327,7 @@ export default {
-## setAttributes +## tawkSetAttributes Set custom metadata regarding this chat/visitor. This function takes in two values: attribute and callback. @@ -1359,11 +1357,11 @@ Error messages returned: `Composition API` ```html