Skip to main content

⚙️ Settings

You can add a settings page that allows users to configure settings for your app.

The user can access the settings by right-clicking the app item in the compose box


Settings

This guide will show how to enable user access to settings, as well as setting up a page that looks like this:

Settings Page

1. Update the Teams Manifest

Set the canUpdateConfiguration field to true in the desired message extension under composeExtensions.

"composeExtensions": [
{
"botId": "${{BOT_ID}}",
"canUpdateConfiguration": true,
...
}
]

2. Serve the settings html page

This is the code snippet for the settings html page:

Save it in the index.html file in the same folder as where your app is initialized.

You can serve it by adding the following code to your app:

note

This will serve the HTML page to the ${BOT_ENDPOINT}/tabs/settings endpoint as a tab. See Tabs Guide to learn more.

3. Specify the URL to the settings page

To enable the settings page, your app needs to handle the message.ext.query-settings-url activity that Teams sends when a user right-clicks the app in the compose box. Your app must respond with the URL to your settings page. Here's how to implement this:

4. Handle Form Submission

When a user submits the settings form, Teams sends a message.ext.setting activity with the selected option in the activity.value.state property. Handle it to save the user's selection: