Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (async function() {
- const res = await fetch("https://MYURLPRIVATE/api/directline/token",
- {
- "method": "GET"
- }
- );
- const {token } = await res.json();
- var t;
- t=token;
- console.log(token);
- var styleOptions = {
- hideUploadButton: true,
- timestampFormat: 'absolute'
- };
- const store = window.WebChat.createStore( {}, ( { dispatch } ) => next => action => {
- return next( action );
- } );
- window.WebChat.renderWebChat(
- {
- directLine: window.WebChat.createDirectLine({ token }),
- locale: 'it-IT',
- styleOptions
- },
- document.getElementById('chatTranscript')
- );
- document.querySelector('#chatTranscript > *').focus();
- })().catch(err => insertError(err))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement