Forum Discussion

Stand's avatar
Stand
Copper Contributor
Sep 25, 2023

Cookies inside Teams Personal App

Hi All,

 

We have a teams tab app which uses Microsoft Clarity to record user sessions in order to assist our product and support teams. However Microsoft Clarity relies on cookies to function correctly but this seems to be blocked inside a personal app.

 

For example each time a user navigates to another screen in the tab app Microsoft clarity treats this as a seperate session recording. Is there a way to have cookies work within Microsoft Teams tab experience?

 

https://clarity.microsoft.com/

  • Stand - You can use the Microsoft Teams JavaScript client library (TeamsJS) to handle navigation within your tab app. The TeamsJS library provides support for navigation within a tab, including types of navigation such as between tabs within the app or through the use of Teams UI components and the back button.

    By using the TeamsJS library, you can provide users access to your web application right within Teams using tabs, without having to sign in again. This way, you can maintain the user's authentication state within the tab app without relying on third-party cookies.

    To implement this solution, you can follow these steps:

    1. Include the TeamsJS library in your tab app. You can find the library and its documentation here.

    2. Use the TeamsJS library to handle navigation within your tab app. You can find examples and documentation on how to use the library for navigation here.

    By using the TeamsJS library for navigation, you can ensure that the user's authentication state is maintained within the tab app, even without relying on third-party cookies. This way, you can continue to use Microsoft Clarity or any other analytics tool that requires cookies within your tab app.

    It's important to note that the TeamsJS library provides support for navigation within a tab, but it doesn't provide direct access to cookies or the ability to enable cookies within the Teams tab experience. However, by using a token-based system or first-party cookies for authentication workflows, you can achieve a similar result without relying on third-party cookies.

    For more information about building tabs for Teams and using the TeamsJS library, you can refer to the following documentation:

    • Stand's avatar
      Stand
      Copper Contributor
      Our app does use TeamsJS... Your response does not address the particular issue at hand and kind of sounds like a generic response generated by chatGPT.
      • Sayali-MSFT's avatar
        Sayali-MSFT
        Icon for Microsoft rankMicrosoft
        Stand - Could you please elaborate more on your requirement and share the repro steps, so that we can try it from our end.

Resources