What's New
Cloud Contact Center Terminology Update

@vue/cli version is above 5.0.0. You can use the following example code to upgrade @vue/cli to v5.0.8.@vue/cli lower version, and there is an error after seamless integration with UIKit, see common issues for problem-solving.npm install -g @vue/cli@5.0.8 sass sass-loader@10.1.1
vue create ai-desk-example

cd ai-desk-example
npm i vue@2.7.9 vue-template-compiler@2.7.9
npm i @vue/composition-api unplugin-vue2-script-setup vue@2.6.14 vue-template-compiler@2.6.14
npm create vite@latest

cd ai-desk-examplenpm install
npm i -D sass sass-loader
echo -n > src/style.css
Clear-Content -Path src/style.css
echo. > src\\style.css
npm i @tencentcloud/ai-desk-customer-vue@latest
mkdir -p ./src/ai-desk-customer-vue && rsync -av --exclude={'node_modules','excluded-list.txt'} ./node_modules/@tencentcloud/ai-desk-customer-vue/ ./src/ai-desk-customer-vue
npm i @tencentcloud/ai-desk-customer-vue@latest
xcopy .\\node_modules\\@tencentcloud\\ai-desk-customer-vue .\\src\\ai-desk-customer-vue /i /e /exclude:.\\node_modules\\@tencentcloud\\ai-desk-customer-vue\\excluded-list.txt
<template><CustomerServiceChat:style="{ width: '600px', height: '80vh', margin: '10px auto', boxShadow: '0 11px 20px #ccc' }"/></template><script setup lang="ts">import TUICustomerServer, { CustomerServiceChat } from './ai-desk-customer-vue';import { onMounted } from "vue";onMounted(() => {const SDKAppID = 0; // Your SDKAppID, the application ID with customer service Desk enabledconst userID = ''; // Your userID, reusable account system of your app or randomly generatedconst userSig = ''; // Your userSig, can be generated by the console during the integration stage, and must be generated by the server during the production stageTUICustomerServer.init(SDKAppID, userID, userSig);});</script><style scoped></style>
<template><div id="app"><CustomerServiceChat:style="{ width: '600px', height: '80vh', margin: '10px auto', boxShadow: '0 11px 20px #ccc' }"/></div></template><script lang="ts" setup>import TUICustomerServer, { CustomerServiceChat } from './ai-desk-customer-vue';import vue from './ai-desk-customer-vue/adapter-vue';const { onMounted } = vue;onMounted(() => {const SDKAppID = 0; // Your SDKAppIDconst userID = ''; // Your userIDconst userSig = ''; // Your userSigTUICustomerServer.init(SDKAppID, userID, userSig);});</script><style lang="scss"></style>
<template><div id="app"><CustomerServiceChat:style="{ width: '600px', height: '80vh', margin: '10px auto', boxShadow: '0 11px 20px #ccc' }"/></div></template><script lang="ts" setup>import TUICustomerServer, { CustomerServiceChat } from './ai-desk-customer-vue';import vue from './ai-desk-customer-vue/adapter-vue';const { onMounted } = vue;onMounted(() => {const SDKAppID = 0; // Your SDKAppIDconst userID = ''; // Your userIDconst userSig = ''; // Your userSigTUICustomerServer.init(SDKAppID, userID, userSig);});</script><style lang="scss"></style>
main.ts/main.js.import VueCompositionAPI from "@vue/composition-api";Vue.use(VueCompositionAPI);
vue.config.js. If not, please create this file.const ScriptSetup = require("unplugin-vue2-script-setup/webpack").default;module.exports = {parallel: false, // disable thread-loader, which is not compactible with this pluginconfigureWebpack: {plugins: [ScriptSetup({/* options */}),],},chainWebpack(config) {// disable type check and let `vue-tsc` handles itconfig.plugins.delete("fork-ts-checker");},};
src/ai-desk-customer-vue/adapter-vue-web.ts file, replace export source:// Initial writingexport * from "vue";// replace withexport * from "@vue/composition-api";
SDKAppID, userID, and userSig in App.vue.

administrator.
module.exports = defineConfig({devServer: {client: {overlay: false,},},});
module.exports = {devServer: {overlay: false,},};
{"exclude": ["node_modules","src/ai-desk-customer-vue",]}
npm run serve
npm run dev
Language Code (UserLang) | Language |
zh_cn | Simplified Chinese |
en | English |
zh_tw | Traditional Chinese |
ja | Japanese |
id | Indonesian |
ms | Malaysian |
vi | Vietnamese |
th | Thai |
fil | Filipino |
ru | Russian |
userLang="en" when using customer service. If you do not specify userLang, UIKit will use the language in browser settings.<template><CustomerServiceChat:style="{ width: '600px', height: '80vh', margin: '10px auto', boxShadow: '0 11px 20px #ccc' }"userLang="en"/></template>
TUICustomerServer.changeLanguage API and trigger a re-render by modifying the page/component key. This ensures language updates are applied immediately.<template><CustomerServiceChat:style="{ width: '600px', height: '80vh', margin: '10px auto', boxShadow: '0 11px 20px #ccc' }":key="locale":userLang="locale"/></template><script setup lang="ts">import TUICustomerServer, { CustomerServiceChat } from './ai-desk-customer-vue';import { onMounted, ref } from "vue";const locale = ref('en');const changeLanguage = (language: string) => {TUICustomerServer.changeLanguage(language).then(() => {locale.value = language;});}</script><style scoped lang="scss"></style>

initWithProfile API to initialize, input Nickname and avatar just.TUICustomerServer.initWithProfile({SDKAppID,userID,userSig,nickName: 'John 1852010****',avatar: 'https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png'})
toolbarButtonList when deploying Desk UIKit. The effect is as shown below:
toolbarButtonList is an array containing one or more items. The description is as follows:Parameter | Type | Required or Not | Description |
title | String | Yes | button Title |
icon | String | No | Button Icon URL |
isPreset | Number | Yes | 1: Built-in feature of the customer service component. 0: Non-built-in feature. |
presetId | String | No | When isPreset is 1, valid values include: humanService: manual service. serviceRating: service evaluation endHumanService: End the session. |
isEnabled | Number | Yes | 1: Render. 0: No render. |
content | String | No | When isPreset is 0, please fill in text content or url. |
type | Number | Yes | 1: the component sends the corresponding text of the content. 2: the component opens the corresponding url. 3 - trigger the specified task flow. 4 -transfer to the specified agents or specified agent group. |
<template><CustomerServiceChat:style="{ width: '600px', height: '80vh', margin: '10px auto', boxShadow: '0 11px 20px #ccc' }":toolbarButtonList="toolbarButtonList"/></template><script setup lang="ts">import TUICustomerServer, { CustomerServiceChat } from './ai-desk-customer-vue';import { onMounted } from 'vue';const toolbarButtonList = [{"title":"manual service","icon":"https://tccc-im-agent-avatar-1258344699.cos.ap-nanjing.myqcloud.com/toolbar_button_1.png","type":1,"content":"","isPreset":1,"presetId":"humanService","isEnabled":1},{"title":"service evaluation","icon":"https://tccc-im-agent-avatar-sg-1258344699.cos.ap-singapore.myqcloud.com/toolbar_button_2.png","type":1,"content":"","isPreset":1,"presetId":"serviceRating","isEnabled":1},{"title":"End Session","icon":"https://tccc-im-agent-avatar-sg-1258344699.cos.ap-singapore.myqcloud.com/toolbar_button_3.png","type":1,"content":"","isPreset":1,"presetId":"endHumanService","isEnabled":1},// Send text{"title":"smart customer service","type":1,"content":"smart customer service","isPreset":0,"isEnabled":1},// Trigger the specified task flow, taskFlowID is the task flow id, if description is empty it will not be displayed in the message list{"title":"Trigger the specified task flow","type":3,"content":{"taskFlowID":3226, "description":"your description"},"isPreset":0,"isEnabled":1},// Transfer to specified agents, specificMemberList is the agent account list{"title":"Transfer to specified agent","type":4,"content":{"specificMemberList":["agent_01@email.com"], "description":"your description"},"isPreset":0,"isEnabled":1},// Transfer to specified agent group, groupID is the customer service agent group ID{"title":"Transfer to specified agent group","type":4,"content":{"groupID":111, "description":"your description"},"isPreset":0,"isEnabled":1}];onMounted(() => {const SDKAppID = 0; // Your SDKAppID, the application ID with customer service Desk enabledconst userID = ''; // Your userID, reusable account system of your app or randomly generatedconst userSig = ''; // Your userSig, can be generated by the console during the integration stage, and must be generated by the server during the production stageTUICustomerServer.init(SDKAppID, userID, userSig);});</script><style scoped></style>
bottomQuickOrder. The effect is as shown below:
Parameter description of bottomQuickOrder is as follows:Parameter | Type | Required or Not | Description |
header | String | Yes | Order title, corresponding to "Product Card" in the image above. |
desc | String | Yes | Order description, corresponding to "$30" in the image above. |
pic | String | No | Order image url. |
url | String | Yes | When the customer service agent receives the order message, click to open the webpage corresponding to this url. |
customField | Array | No | Custom configuration, such as "order ID", "order time", etc. |
<template><CustomerServiceChat:style="{ width: '600px', height: '80vh', margin: '10px auto', boxShadow: '0 11px 20px #ccc' }":bottomQuickOrder="bottomQuickOrder"/></template><script setup lang="ts">import TUICustomerServer, { CustomerServiceChat } from './ai-desk-customer-vue';import { onMounted } from 'vue';const bottomQuickOrder = {header: "Product Card",desc: "$30",pic: "https://static.cloudcachetci.com/qcloud/portal/kit/images/presale.a4955999.jpeg",url: 'https://your_url.com',customField: [{name: 'Order ID',value: '11111111111111111111'},{name: 'Order Time',value: '2025-07-02 16:23'}]};onMounted(() => {const SDKAppID = 0; // Your SDKAppIDconst userID = ''; // Your userIDconst userSig = ''; // Your userSigTUICustomerServer.init(SDKAppID, userID, userSig);});</script><style scoped></style>
TUICustomerServer.initWithProfile({SDKAppID,userID,userSig,nickName: 'John 1852010****'avatar: 'https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png'}).then(() => {TUICustomerServer.transferToHuman({specificMemberList: ['agent_account_1', 'agent_account_2'], // replace with your agent accountsdescription: 'your description'});});
TUICustomerServer.initWithProfile({SDKAppID,userID,userSig,nickName: 'John 1852010****'avatar: 'https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png'}).then(() => {TUICustomerServer.transferToHuman({groupID: 0, // replace with your customer service agent group IDdescription: 'your description'});});
TUICustomerServer.initWithProfile({SDKAppID,userID,userSig,nickName: 'John 1852010****'avatar: 'https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png'}).then(() => {TUICustomerServer.transferToTaskFlow({taskFlowID: 0, // replace with your task flow iddescription: 'your description'});});
// 1. Pass the custom customer service account ID from the business side to UIKit before initializationTUICustomerServer.setCustomerServiceIDList(['customerServiceID_001', 'customerServiceID_002', 'customerServiceID_003']);// 2. During initialization, include the customer service account ID to start conversation, such as 'customerServiceID_002'// If no customer service account ID is specified to start conversation, UIKit uses the first element in the multiple customer service accounts list by defaultTUICustomerServer.initWithProfile({SDKAppID,userID,userSig,nickName: 'John 1562010****',avatar: 'your avatar url',customerServiceID: 'customerServiceID_002',});
TUICustomerServer.sendCustomMessage({to: '@customer_service_account',conversationType: 'C2C',payload: {data: JSON.stringify({src: '27',customerServicePlugin: 0,}),},}, { onlineUserOnly: true });
vue add typescript

npm install -D typescript

npm i marked@5.1.2 --legacy-peer-deps

npm i marked@6.0.0 --legacy-peer-deps
フィードバック