Connect your React app to Microsoft 365
Tags: microsoftgraphtoolkit, microsoftgraph, microsoft365, microsoft
Published: 2020-11-11 08:12:16

---
title: Connect your React app to Microsoft 365
published: true
date: 2020-11-10 11:57:14 UTC
tags: microsoftgraphtoolkit,microsoftgraph,microsoft365,microsoft
canonical_url: https://blog.mastykarz.nl/connect-react-app-microsoft-365/
---

![Connect your React app to Microsoft 365](https://blog.mastykarz.nl/assets/images/2020/10/mgt-banner.png)

With the Microsoft Graph Toolkit, you'll be able to connect your app to Microsoft 365 in a matter of minutes. Here is how you'd do it.

## 250 million reasons to build on Microsoft 365

[Microsoft 365](https://www.microsoft.com/microsoft-365?WT.mc_id=m365-10353-wmastyka), previously known as Office 365, is the productivity cloud from Microsoft used by 250 million people every day to collaborate and communicate. It's also a highly extensible development platform. All the information about its users as well as the content they create is stored in Microsoft 365 and, bearing the necessary permissions, available for you to interact with in your applications.

## Connect your app to Microsoft 365

There are a number of different types of apps you can build for Microsoft 365. You can tap into one or more extensibility points or you can connect your existing web- or mobile app to Microsoft 365 and combine the information from the person's organization to your app, making your app more valuable.

## The easiest way to connect to Microsoft 365

You connect to Microsoft 365 using [Microsoft Graph](https://developer.microsoft.com/graph?WT.mc_id=m365-10353-wmastyka): a REST API that connects all services and data stored in Microsoft 365. And while you can communicate with it manually, building authentication and composing the right requests yourself, there is a better, much easier way to do it.

[Microsoft Graph Toolkit](https://docs.microsoft.com/graph/toolkit/overview?WT.mc_id=m365-10353-wmastyka) is a set of web components that abstract away the plumbing behind connecting to Microsoft Graph and allow you to focus on your application instead. Microsoft Graph Toolkit is available as a generic set of web components distributed through the **@microsoft/mgt** npm package.

If you're building apps with React, you can use the **@microsoft/mgt-react** package which wraps MGT web component in React components making it easier to pass complex data and hook the components up to events.

Recently, we have published a new walkthrough taking you step-by-step through the process of [creating a React app, connecting to Microsoft 365 and retrieving data for the currently signed in user](https://docs.microsoft.com/graph/toolkit/get-started/use-toolkit-with-react?WT.mc_id=m365-10353-wmastyka).

 ![React app showing data from Microsoft 365 using Microsoft Graph Toolkit](https://blog.mastykarz.nl/assets/images/2020/10/mgt-finished-app.png)  

When you check out the walkthrough, notice, how throughout the whole process, you didn't need to issue a single request to Azure AD to get an access token, or ensure that you handle errors and edge cases properly. See, how you didn't need to manually build requests to Microsoft Graph to get the data and parse the response?

This is **exactly** what makes Microsoft Graph Toolkit shine. **With Microsoft Graph Toolkit you can focus on building your application rather than its plumbing.**

The above example is relatively simple - on purpose, to help you understand the main concepts when using Microsoft Graph Toolkit. Microsoft Graph Toolkit is highly customizable and versatile, and new components are being added to it regularly to help you build apps on Microsoft 365.

If you haven't tried Microsoft Graph Toolkit yet, I'd highly recommend you do. And I'd love to hear what you think of it.

Check out the walkthrough: [Use the Microsoft Graph Toolkit with React](https://docs.microsoft.com/graph/toolkit/get-started/use-toolkit-with-react?WT.mc_id=m365-10353-wmastyka)