Implementing Configurable Tabs for MS Teams with Yo Teams
Overview
Custom tabs can be used with the app to embed our own content in MS Teams. MS Teams supports 2 types of tabs.
- Channel/group tab: delivers content to channels and group chats.
- Personal tab: scoped to a single user.
In this article, we will explore web experiences with custom configurable tabs in Microsoft Teams using Yo Teams.
Configurable Tabs overview
Tabs are Teams-aware webpages embedded in Microsoft Teams. Configurable tabs give you the opportunity to allow the user to specify some configuration information before the tab is added.
Prerequisites
Install below to get started:
- Node.js - v10.* (or higher)
- NPM (installed with Node.js) - v6.* (or higher)
- Gulp - v4.* (or higher)
- Yeoman - v3.* (or higher)
- Yeoman Generator for Microsoft Teams - v2.13.0 (or higher)
- Visual Studio Code
Install Yeoman, Gulp global command-line interface, and Typescript compiler globally using NPM.
npm install yo gulp-cli typescript --global
Install generator-teams globally using NPM.
npm install generator-teams --global
To install preview versions of the generator, run below command.
npm install generator-teams@preview --global
Implement Configurable Tabs with Yo Teams
We will generate a solution using Yo Teams.
-
On the command prompt, type below command.
yo teams
-
Follow the wizard to set up the solution.
- On the command prompt, type code . to open the solution in visual studio code.
- If you want to test the configurable app locally, on the command prompt type
gulp serve
and the information will be displayed from the file “src\app\web\index.html”. - When we are running the configurable app from within MS Teams, the information will be rendered from “src\app\scripts\configurableTab\ConfigurableTab.tsx”.
Test the solution
Follow the below steps to test the configurable tab locally with ngrok.
-
On the command prompt, run below command.
gulp ngrok-serve
- Open MS Teams.
-
Under Apps, click Upload a custom app.
- Navigate to any Team.
- Click Add a tab.
-
Search and add ConfigurableTab.
-
Click Add.
-
Specify the title, click Save.
-
Once added, the configurable tab looks as below.
Summary
Tabs are Teams-aware webpages embedded in Microsoft Teams. Configurable tabs give you the opportunity to allow the user to specify some configuration information before the tab is added. Yo Teams
helps to build configurable apps with ease.
References
Code Download
The code developed during this article can be found at: https://github.com/nanddeepn/code-samples/tree/master/MSTeams/yo-teams/configurable-tab
Leave a comment