Language

HtmlWidgetHelpers.InjectWidgetProtocol Method

Definition

Injects the MCP Apps protocol script into widget HTML. If the HTML already contains the protocol (detected by "ui/initialize"), it is returned unchanged.

public static string InjectWidgetProtocol(string html, Microsoft.Teams.Apps.HtmlWidget.InjectWidgetProtocolOptions? options = default);
static member InjectWidgetProtocol : string * Microsoft.Teams.Apps.HtmlWidget.InjectWidgetProtocolOptions -> string
Public Shared Function InjectWidgetProtocol (html As String, Optional options As InjectWidgetProtocolOptions = Nothing) As String

Parameters

html
String

The raw HTML content for the widget.

options
InjectWidgetProtocolOptions

Optional configuration for the protocol setup.

Returns

The HTML with the protocol script injected.

Applies to