I don't think this can be made by an option/configuration...
I'm not a JS/JQuery/css jedi, have you a piece of code to copy/paste in my html page to toggle the copilot frame on/off ?
Something like a button or an image to click to hide/show the copilot box on a webpage?
Thx a lot
@adilei I see that with the code you passed me, copilot creates a new session every time the page is loaded.... this creates a bomb of sessions and doesn't allow me to use the analytic page of copilot.... do you think it would be possible to create the copilot's session only on click on Copilot button (on showChat JS function)?
eh thank you but this is for "ninja JS" level... how have I to add that to my custom canvas?
Have a look here: CopilotStudioSamples/BuildYourOwnCanvasSamples/3.single-sign-on/index.html at master · microsoft/CopilotStudioSamples (github.com)
if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY') {
const activity = action.payload.activity;
let resourceUri;
if (activity.from && activity.from.role === 'bot' && (resourceUri = getOAuthCardResourceUri(activity))) {
exchangeTokenAsync(resourceUri).then(function(token) {
if (token) {
directLine.postActivity({
type: 'invoke',
name: 'signin/tokenExchange',
value: {
id: activity.attachments[0].content.tokenExchangeResource.id,
connectionName: activity.attachments[0].content.connectionName,
token
},
"from": {
id: userId,
name: clientApplication.account.name,
role: "user"
}
}).subscribe(
id => {
if (id === 'retry') {
// bot was not able to handle the invoke, so display the oauthCard
return next(action);
}
// else: tokenexchange successful and we do not display the oauthCard
},
error => {
// an error occurred to display the oauthCard
return next(action);
}
);
return;
} else {
return next(action);
}
});
} else {
return next(action);
}
} else {
return next(action);
}
@adilei may you suggest me how to add the token variable you suggested me in another topic
Your are THE man!
Here is a simple, non-jedi example: A static page rendering PVA chatbot as a floating widget (github.com)
Romain The Low-Code...
25
Pablo Roldan
25
stampcoin
10