|
| 1 | +<html> |
| 2 | + <head> |
| 3 | + <title>Main 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>Main SFW</h1> |
| 8 | + <h2>godwin@sdb6.org</h2> |
| 9 | + |
| 10 | + <!-- Edit page link --> |
| 11 | + <p><a id="editThisPageLink" target="_blank" style="color:blue">Edit this page</a></p> |
| 12 | + </br> |
| 13 | + |
| 14 | + <label for="idToken">Set identity token:</label> |
| 15 | + <input type="text" id="idToken" name="idToken" size="50"> |
| 16 | + <button type="button" id="setIdentityToken" onclick="setIdentityToken()"> Confirm </button> |
| 17 | + </br> |
| 18 | + </br> |
| 19 | + <button type="button" id="clearAuthBtn" onclick="clearAuthSession()"> Clear Authorization Session </button> |
| 20 | + |
| 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 | + </script> |
| 43 | + <script type='text/javascript'> |
| 44 | + function initEmbeddedMessaging() { |
| 45 | + try { |
| 46 | + embeddedservice_bootstrap.settings.language = 'en'; // For example, enter 'en' or 'en-US' |
| 47 | + embeddedservice_bootstrap.settings.devMode = true; |
| 48 | + |
| 49 | + // SDB3 |
| 50 | + // embeddedservice_bootstrap.init( |
| 51 | + // '00DSB0000004st3', |
| 52 | + // 'EmbeddedMessaging_ExternalBot', |
| 53 | + // 'https://godwin.my.site-com.yat-law-onin1thy590y0.wa.crm.dev:6101/ESWMIAW1732575961496', |
| 54 | + // { |
| 55 | + // scrt2URL: 'https://godwinlaw-sdb3.test1.my.pc-rnd.salesforce-scrt.com' |
| 56 | + // } |
| 57 | + // ); |
| 58 | + // SDB6 |
| 59 | + embeddedservice_bootstrap.init( |
| 60 | + '00DSG000003UGaH', |
| 61 | + 'MessagingWeb_One', |
| 62 | + 'https://godwin.my.site-com.yat-law-onin1thy590y0.wa.crm.dev:6101/ESWMIAW1732575961496', |
| 63 | + { |
| 64 | + scrt2URL: 'https://godwin-sdb6.test1.my.pc-rnd.salesforce-scrt.com' |
| 65 | + } |
| 66 | + ); |
| 67 | + } catch (err) { |
| 68 | + console.error('Error loading Embedded Messaging: ', err); |
| 69 | + } |
| 70 | + }; |
| 71 | + </script> |
| 72 | + <script type='text/javascript' src='https://godwin.my.site-com.yat-law-onin1thy590y0.wa.crm.dev:6101/ESWMIAW1732575961496/assets/js/bootstrap.js' onload='initEmbeddedMessaging()'></script> |
| 73 | +</html> |
0 commit comments