|
| 1 | +<html> |
| 2 | + <head> |
| 3 | + <title>262 SFW</title> |
| 4 | + <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0"> |
| 5 | + </head> |
| 6 | + <body> |
| 7 | + <h1>262 SFW</h1> |
| 8 | + <!--<h2>SDB27 Orgfarm: epic.out.d9ef8dfca8b7@orgfarm.salesforce.com</h2>--> |
| 9 | + <h2>SDB3: godwin@agent.sdb3.org</h2> |
| 10 | + |
| 11 | + <!-- Edit page link --> |
| 12 | + <p><a id="editThisPageLink" target="_blank" style="color:blue">Edit this page</a></p> |
| 13 | + </br> |
| 14 | + |
| 15 | + <label for="idToken">Set identity token:</label> |
| 16 | + <input type="text" id="idToken" name="idToken" size="50"> |
| 17 | + <button type="button" id="setIdentityToken" onclick="setIdentityToken()"> Confirm </button> |
| 18 | + </br> |
| 19 | + </br> |
| 20 | + <button type="button" id="clearAuthBtn" onclick="clearAuthSession()"> Clear Authorization Session </button> |
| 21 | + <script type='text/javascript'> |
| 22 | + document.getElementById('editThisPageLink').href = "https://github.com/ESW1234/esw1234.github.io/edit/master" + window.location.pathname; |
| 23 | + |
| 24 | + function clearAuthSession() { |
| 25 | + console.log("Clearing user session."); |
| 26 | + embeddedservice_bootstrap.userVerificationAPI.clearSession(); |
| 27 | + } |
| 28 | + |
| 29 | + function setIdentityToken(token) { |
| 30 | + var token = document.getElementById("idToken").value; |
| 31 | + |
| 32 | + embeddedservice_bootstrap.userVerificationAPI.setIdentityToken({ |
| 33 | + "identityTokenType":"JWT", |
| 34 | + // Valid JWT |
| 35 | + "identityToken": token |
| 36 | + }); |
| 37 | + } |
| 38 | + |
| 39 | + window.addEventListener("onEmbeddedMessagingReady", () => { |
| 40 | + console.log("onEmbeddedMessagingReady emitted"); |
| 41 | + }); |
| 42 | + |
| 43 | + window.addEventListener("onEmbeddedMessageSent", (data) => { |
| 44 | + console.log("onEmbeddedMessageSent emitted"); |
| 45 | + console.log(data.detail); |
| 46 | + }); |
| 47 | + |
| 48 | + window.addEventListener("onEmbeddedMessageLinkClicked", (data) => { |
| 49 | + console.log("onEmbeddedMessageLinkClick emitted"); |
| 50 | + console.log(data.detail); |
| 51 | + }); |
| 52 | + </script> |
| 53 | + <script type='text/javascript'> |
| 54 | + function initEmbeddedMessaging() { |
| 55 | + try { |
| 56 | + agentforce_messaging.settings.language = 'en_US'; // For example, enter 'en' or 'en-US' |
| 57 | + agentforce_messaging.settings.devMode = true; |
| 58 | + // SDB27 |
| 59 | + // agentforce_messaging.init( |
| 60 | + // '00DLT000009AACD', |
| 61 | + // 'CWC', |
| 62 | + // 'https://orgfarm-152e83a520.my.site-com.or99gum5osft0k2npmgfv7dl418f4k.wb.crm.dev:6101/ESWCWC1758556968883', |
| 63 | + // { |
| 64 | + // scrt2URL: 'https://orgfarm-d4cf2dec58.test1.my.pc-rnd.salesforce-scrt.com' |
| 65 | + // } |
| 66 | + // ); |
| 67 | + |
| 68 | + // SDB3 |
| 69 | + embeddedservice_bootstrap.init( |
| 70 | + '00DSB00000RoOKZ', |
| 71 | + 'CWC_Branded', |
| 72 | + 'https://orgfarm-0645aded6b.my.site-com.30jbyue91hyk05irc390rge.wc.crm.dev:6101/ESWMIAW1765836270290', // V2 |
| 73 | + { |
| 74 | + scrt2URL: 'https://godwinlaw-sdb3-agentforce.demo.test1.my.pc-rnd.salesforce-scrt.com' |
| 75 | + } |
| 76 | + ); |
| 77 | + } catch (err) { |
| 78 | + console.error('Error loading Embedded Messaging: ', err); |
| 79 | + } |
| 80 | + }; |
| 81 | + </script> |
| 82 | + <!----> |
| 83 | + <script type='text/javascript' src='https://orgfarm-0645aded6b.my.site-com.30jbyue91hyk05irc390rge.wc.crm.dev:6101/ESWMIAW1765836270290/assets/js/init.js' onload='initEmbeddedMessaging()'></script> |
| 84 | + <!-- |
| 85 | + <script type='text/javascript' src='https://esw1234.github.io/godwin/assets/js/init.js' onload='initEmbeddedMessaging()'></script> |
| 86 | + --> |
| 87 | + </body> |
| 88 | +</html> |
0 commit comments