Forum Discussion
Trying to understand MS Teams "Tab App"
- I understand I can preserve state in my own backend, but it's there any way to preserve any small bit of identifying info in a tab app itself? For example, you mentioned I could implement my own auth instead of using SSO. If there is no way to store state, though (like cookies or local storage APIs), how would I persist their auth or session token (client side) between "visits" to the tab? Even if it was just one simple token string identify them. I can't have them logging in repeatedly.
- My goal with notifications is to have a toast notification pop up in the corner that they can click on to deep link them into the tab and into my app regardless of where they might be in Teams itself- in a meeting, in a totally unrelated chat, in another app's tab, etc. Do "bots" allow this, or is a bot something you have to add to a specific Teams conversation? Is a bot a while secondary/separate app or would it be part of the same tab app?
AlexKozler - Yes, you can use the local storage APIs to store state, such as a session token or other identifying information, between visits to the tab. This can be done by using the localStorage
or sessionStorage
objects to store key-value pairs. These objects allow you to store data on the client side, and the data persists even after the browser is closed or the user navigates away from the page. This way, you can persist the user's authentication or session token between visits to the tab, without requiring them to log in repeatedly.
For notifications, you can use a bot to send a message with a deep link to your tab. This method is preferred especially if the tab thread is targeted. A bot can be part of the same tab app and it's not a separate app. You can @mention specific users if needed.