diff --git a/app/javascript/packs/sdk.js b/app/javascript/packs/sdk.js index 8c7c97dee..9fb4d1976 100755 --- a/app/javascript/packs/sdk.js +++ b/app/javascript/packs/sdk.js @@ -13,6 +13,7 @@ const runSDK = ({ baseUrl, websiteToken }) => { websiteToken, locale: chatwootSettings.locale, type: getBubbleView(chatwootSettings.type), + launcherTitle: window.chatwootSettings.launcherTitle || '', toggle() { IFrameHelper.events.toggleBubble(); diff --git a/app/javascript/sdk/IFrameHelper.js b/app/javascript/sdk/IFrameHelper.js index 6858f3a40..b868ef51f 100644 --- a/app/javascript/sdk/IFrameHelper.js +++ b/app/javascript/sdk/IFrameHelper.js @@ -113,7 +113,7 @@ export const IFrameHelper = { }, setBubbleLabel(message) { - setBubbleText(message.label); + setBubbleText(window.$chatwoot.launcherTitle || message.label); }, toggleBubble: () => { diff --git a/docs/channels/website-sdk.md b/docs/channels/website-sdk.md index b6d0497d2..84cd2a12a 100644 --- a/docs/channels/website-sdk.md +++ b/docs/channels/website-sdk.md @@ -37,6 +37,15 @@ Chatwoot support 2 designs for for the widget ![Expanded-bubble](./images/sdk/expanded-bubble.gif) +If you are using expanded bubble, you can customize the text used in the bubble by setting `launcherText` parameter on chatwootSettings as described below. + +```js +window.chatwootSettings = { + type: 'expanded_bubble', + launcherText: 'Chat with us' +} +``` + ### To trigger widget without displaying bubble ```js