Search code examples
microsoft-teamsmanifest

Can I limit which elements of my webapp will be shown on my teamsTab


I am working on an existing web app which exists for 7 years so it has a lot of features/options.

I have a side bar menu with 9 items and I want one of them to be integrated on Microsoft Teams as a Tab, more exactly a configurable Tab as I want it to work for a team of people only - meaning I don't want the app to be available for a personal usage.

Is it possible to create a configuration from the manifest that would allow or fobid some part of my website by paths for example ? Else can I add some condition on my code ? Is my code aware of being used in a Team Iframe ?

Thanks

For now I am able to add my app on a Tab, and connect via the login page on my custom Tab, after what my entire website is accessible.


Solution

  • In order for you app to work nicely in Teams, you should be referencing the Teams JS library in any case. See more at https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/using-teams-client-library?tabs=javascript%2Cmanifest-teams-toolkit . Part of that is the ability to get the user's Teams context, which, amongst other things, you can use to check if the user is actually within a Teams context. TeamsFx, a related project, could also be of use for this I think: https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teamsfx-sdk

    This might also be useful, as a shorter way: https://github.com/OfficeDev/microsoft-teams-library-js/issues/469#issuecomment-973054576