Add Microsoft Teams chats to SharePoint

In today’s work environment, we’ve all witnessed the transformation of how we get things done. Work is all about collaboration, flexibility, and staying connected. Chances are you’ve heard that technology should be where you work, seamlessly integrated into your daily routine.

Microsoft understands this need and has made great improvements in that direction. While most applications were brought into Microsoft Teams, there is another exciting perspective worth exploring: bringing Microsoft Teams to your SharePoint intranet.

Microsoft Teams chat in SharePoint sites

In this blog post, I’m showing you how to do just that. I’ll guide you through the process of integrating Microsoft Teams chats into your SharePoint intranet, including a custom solution that I developed for this purpose.

For a while, I’ve had the idea of creating an integrated chat for SharePoint using Microsoft Teams, like the one found on LinkedIn. However, this requires a substantial amount of work, and writing a Microsoft Teams custom application solely for this purpose seemed too much.

I’ve had this project idea bouncing around in my head for a while. But one day, as I was casually scrolling through the latest Microsoft Teams updates, I stumbled upon a new feature that makes links shared in Teams conversations open right next to the related website, giving you a better feel for the context.

Microsoft Teams chat in SharePoint sites

This was the perfect solution to implement the Microsoft Teams chat inside SharePoint and after exploring it a bit I concluded that it was viable and built the extension you are now reading about in this post.

How to add Microsoft Teams chats to SharePoint sites

If you are willing to know more about the implementation details have a look to here where I explain how things were made.

Before we jump into the details of the installation process make sure you download the sppkg package from here.

  1. Extract the zip file, inside you will find a sppkg to install the solution in your SharePoint tenant
  2. Open the SharePoint app catalog and upload the chat-embedded.sppkg
  3. Check the option Enable this app and it to all sites, this will make the app available in all modern SharePoint site for all the users
    Microsoft Teams chat in SharePoint sites
  4. Click Enable app
  5. Click Go to API access page, this step is required to see the profile picture of the user in the extension
  6. Select the Read permission from the chat-embedded-client-side-solution and click Approve
    Microsoft Teams chat in SharePoint sites

Navigate to any page in your organization and you will see the extension at the bottom of the page. If you are not yet authenticated in Microsoft Teams in the browser you will have to do it the first time you use the extension, after it you will be able to simply have conversations from any SharePoint page as shown in the following animation.

Note this extension takes advantage of an integration made by Microsoft and it automatically gets the color of the theme from your operating system, so it automatically chooses the light or dark themes.

If you want to see it in action have a look to the video below, and make sure you follow me on social media and YouTube so you don’t miss future updates and cool integrations for your SharePoint intranet.

Download Solution
Explore on GitHub


29 Responses to “Add Microsoft Teams chats to SharePoint”

  1. Joao Almeida

    October 27, 2023

    Hi Joao, I published your solution in a tenant, but the all users appear with “Unknown User” (and I did give permissions to graph api) Did you know what happens?

    Thanks for your solution!!

    Reply
    • João Ferreira

      November 16, 2023

      Do you see the unknown user in the chat window or in the component to open it?

      Reply
  2. vishal

    November 6, 2023

    I have used your code facing one issued at bottom placeholder show error message object is possibly undefined

    Reply
  3. João Ferreira

    November 15, 2023

    If you are not using Edge make sure you open Teams in EDGE in the browser and then refresh the SharePoint page again.
    I had a Chrome user reporting that it only worked after Teams was launched in EDGE for the first time, once he did it, it started working in all browsers.

    Reply
  4. Drena

    November 15, 2023

    Thank you so much for creating this. I’m not able to get it to work though. I am using Edge and have opened Teams in the browser and refreshed. The Team app just doesn’t show up on the page. Is there anything I need to turn on in the tenant to make it work?

    Reply
    • João Ferreira

      November 16, 2023

      Have you installed it in the global app catalog and made it enabled to all the modern SharePoint sites?
      If that is the case, check the browser console and let me know if you see any error related to the extension.

      Reply
      • Drena

        November 21, 2023

        Thank you for leading me in the right direction. There was an error on retrieving my photo. I didn’t have a photo, so I uploaded one, and after that it worked. Is there a way around that, if someone does not have a photo in M365?

        Reply
        • João Ferreira

          February 9, 2024

          I’ll need to fix it so it works for all users with and without a photo.

          Thanks for letting me know.

          Have a nice day 🙂

          Reply
  5. Charles Burton

    November 24, 2023

    Hello Mr. Ferreira,

    I really like the look and feel similar to the LinkedIn messaging. My observation is that it provides full Teams functionality to users.

    Can you imagine a functionality that would limit or target a specific Teams channel?

    Seeking to provide a support type Teams chat without full Teams functionality.

    Keep up the great work.

    Reply
    • João Ferreira

      February 8, 2024

      Hi Charles,

      That is not possible using a solution like this one that is leveraging what Microsoft built for outlook.
      To implement something like that you would need to build a custom solution using the Microsoft Graph APIs to get the messages for a specific channel.

      Have a nice day 🙂

      Reply
  6. DVD410

    December 1, 2023

    Hi !

    Thank you for this tip, it works very nice ! Even if we deploy it only on the appCatalog of a single site and not global appCatalog.

    One question : is it possible to hide it or move it if some users want it ? Sometimes it can hide some SharePoint system buttons.

    Thanks !

    Reply
    • João Ferreira

      January 26, 2024

      Hi David,

      With the current version is not possible but it starts bother me sometimes as it stays on top of some save buttons.
      I’ll add to my back log make it draggable so users can move it if it hides important buttons.

      Have a nice day 🙂

      Reply
  7. Sachin

    December 4, 2023

    I have imported this in my sharepoint and it works effortlessly but still i am eager to open a chat directly instead of opening the lists of chats i want to open the single chat
    can you help me to achieve this..?

    Reply
  8. Josh

    January 15, 2024

    Hello again, João. I’ve walked through several times but only receive the same errors. I’d love a couple of updates but have tried your out-of-the-box package first. So far, I have:

    > loaded in the catalog for all sites
    > opened Teams in EDGE first (and did a hard refresh)

    First:
    Could not load teams-chat-embedded-application-customizer in require. TypeError: Cannot read properties of undefined (reading ‘id’)

    Second:
    ‘ClientSideExtension.ApplicationCustomizer.c129df59-b7ec-487d-b748-e197e12a16f8’. Error information is ‘Extension failed to load for componentId “c129df59-b7ec-487d-b748-e197e12a16f8”.’.

    Reply
    • Josh

      January 15, 2024

      One more thing: API is already approved via another app (PnP search).

      Reply
      • João Ferreira

        January 26, 2024

        If the permission is already granted you don’t need to do it again, it will use the same permission from Search.

        Reply
    • Josh

      January 15, 2024

      Well….it worked when adding/installing it to all sites. Is that a requirement? I’d love to initially add to a few for testing/project requirements.

      Reply
    • João Ferreira

      January 26, 2024

      Josh,

      I’m replying to your comments in the wrong order, I’m assuming you made it work already.
      If not please let me know so I can investigate further the issue.

      Have a nice day 🙂

      Reply
  9. RC

    February 2, 2024

    Hi Josh

    Trying to get this to work but, not seeing any teams extension at the bottom of the page. I have tried logging into teams online in Edge and then refreshing SharePoint site but still no joy.

    Reply
    • João Ferreira

      February 4, 2024

      Hi Russell,

      Do you see any error in the browser console?
      On your app catalog navigate to the tenant wide extension list and check if you see the TeamsChatEmbedded item in the list.
      Where is the Tenant Wide Extensions list located?

      If you don’t see it please follow the installation steps again.

      Have a nice day 🙂

      Reply
      • RC

        February 4, 2024

        Hi

        It was not in the Tenant Wide Extension list so went through steps again and its now there. Cant see it after change, getting errors in the browser console still…

        Failed to load resource: the server responded with a status of 404 () graph.microsoft.com/v1.0/me/photo/$value:1

        Reply
        • João Ferreira

          February 5, 2024

          Hi Russel,

          Do you have a profile picture defined in Microsoft 365?
          If you do, please make sure the permissions on #6 are approved.

          Have a nice day 🙂

          Reply
  10. sumana bhattacharyya

    February 7, 2024

    can’t see that app at footer

    Reply
    • João Ferreira

      February 7, 2024

      Hello,

      Do you see any error in the browser console?
      On your app catalog navigate to the tenant wide extension list and check if you see the TeamsChatEmbedded item in the list.
      Where is the Tenant Wide Extensions list located?

      If you don’t see it please follow the installation steps again.

      Have a nice day

      Reply

Leave a Reply


I've been working with Microsoft Technologies over the last ten years, mainly focused on creating collaboration and productivity solutions that drive the adoption of Microsoft Modern Workplace.

%d bloggers like this: