Advertisement
mrkGoogle

scriptAzure

Apr 26th, 2023 (edited)
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (async function() {
  2.                             const res = await fetch("https://MYURLPRIVATE/api/directline/token",
  3.                               {
  4.                                 "method": "GET"
  5.                               }
  6.                             );
  7.                             const {token } = await res.json();
  8.                             var t;
  9.                             t=token;
  10.                             console.log(token);
  11.                             var styleOptions = {
  12.                                     hideUploadButton: true,
  13.                                     timestampFormat: 'absolute'
  14.                                 };
  15.                             const store = window.WebChat.createStore( {}, ( { dispatch } ) => next => action => {
  16.                                 return next( action );
  17.                               } );
  18.                             window.WebChat.renderWebChat(
  19.                               {
  20.                                 directLine: window.WebChat.createDirectLine({ token }),
  21.                                 locale: 'it-IT',
  22.                                 styleOptions
  23.                               },
  24.                               document.getElementById('chatTranscript')
  25.                             );
  26.  
  27.                             document.querySelector('#chatTranscript > *').focus();
  28.                           })().catch(err => insertError(err))
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement