angularasp.net-corebotframeworkweb-chat

AdaptiveCards HostConfig Integration


Does anyone know how to integrate a HostConfig for styling AdaptiveCards using webchat CDN in Asp.Net Core?

For example what is the file name? Where does it go etc?

My project setup is: Asp.Net Core with Angular


Solution

  • RenderWebChat takes a parameter called adaptiveCardHostConfig where you can pass your config. You can take a look at the webchat API reference here https://github.com/microsoft/BotFramework-WebChat#web-chat-api-reference

    Example

    window.WebChat.renderWebChat({
            adaptiveCardHostConfig: {
                actions: {
                    actionsOrientation: 'horizontal',
                }
            },
            styleOptions: {
                rootHeight: 500,
                rootWidth: 500,
    
            },
            directLine: dl,
            userID: '@Model.UserId',
            username: 'User',
            locale: 'en-US',
        }, document.getElementById('webchat'));