-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (74 loc) · 2.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<title>DaVita Sandbox</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://rjbqob.csb.app/src/styles.css" />
</head>
<body>
<!-- <script src="src/index.js" /></script> -->
<script text="javascript" src="src/virtualAgentBootstrapLoader.js"></script>
<img
src="https://prd-cdn-talkdesk.talkdesk.com/cdn-assets/latest/talkdesk/brand/main_brand/logo/talkdesk_logo_purple.svg"
/>
<h1>Live Chat + VA Example</h1>
<!-- Start of Talkdesk Code -->
<script>
var webchat;
((window, document, node, props, configs) => {
if (window.TalkdeskChatSDK) {
console.error("TalkdeskChatSDK already included");
return;
}
var divContainer = document.createElement("div");
divContainer.id = node;
document.body.appendChild(divContainer);
var src = `https://talkdeskchatsdk.talkdeskapp.com/talkdeskchatsdk.js`;
var script = document.createElement("script");
var firstScriptTag = document.getElementsByTagName("script")[0];
script.type = "text/javascript";
script.charset = "UTF-8";
script.id = "tdwebchatscript";
script.src = src;
script.async = true;
firstScriptTag.parentNode.insertBefore(script, firstScriptTag);
script.onload = () => {
webchat = TalkdeskChatSDK(node, props);
webchat.init(configs).then(() => {
webchat.setContextParam({ sf_contactid: "sf12345_A0E678" });
window.virtualAgentBootstrapLoader(webchat, {
openAFterTimeout: 1000
});
});
/*
* Send custom data from your website to TalkDesk!
* If you would like to do it, you need to remove the following commented code and
* modify the webchat.setContextParam parameters to pass in the data you need.
*/
/*function setContext() {
webchat.setContextParam({ "var1": "value1", "var2": "value2", "var3": 100 })
}
// Send data when the chat conversation is initiated
webchat.onConversationStart = function() {
setContext()
}
// Send data when the chat widget is open
webchat.onOpenWebchat = function() {
setContext()
}*/
};
})(
window,
document,
"tdWebchat",
{
flowId: "60d4de183c6f493c8f78810cb151de8d",
accountId: "",
region: "td-us-1"
},
{ enableEmoji: true, enableUserInput: true }
);
</script>
<!-- End of Talkdesk Code -->
</body>
</html>