Microsoft Graph Toolkit adds a new Electron Provider plus enhanced capabilities

Microsoft Graph team

Today, we released version 2.1 of the Microsoft Graph Toolkit. This release includes a new authentication provider for Electron applications, as well as improvements and bug fixes for the existing components and providers. 

As a recap, the Microsoft Graph Toolkit  is a collection of components and providers that makes your integration with Microsoft Graph as easy as writing two lines of code. To learn more, read the documentation, try the getting started tutorial, or clone and run this sample to see it in action.

Updating your application

To update your application to use the newest version of Microsoft Graph Toolkit, go to your project directory and run: 

npm i @microsoft/mgt@latest

If you’re using the Toolkit via mgt-loader, your application will be automatically updated to the newest version. 

What’s New?

Electron provider

The Microsoft Graph Toolkit authentication providers enable you to easily implement authentication with the Microsoft Identity Platform for your application. 

The new Electron provider uses msal-node to sign in users and acquire access tokens to request data from Microsoft Graph inside of an Electron application. It is available on all platforms where Electron applications can run. 

To use it, add it to your Electron app with: 

npm install @microsoft/mgt-element @microsoft/mgt-electron-provider

Create the ElectronProvider in your renderer process: 

import {Providers} from '@microsoft/mgt-element'; 

import {ElectronProvider} from '@microsoft/mgt-electron-provider/dist/Provider'; 

Providers.globalProvider = new ElectronProvider();

And initialize the ElectronAuthenticator in your main process: 

import { ElectronAuthenticator } from '@microsoft/mgt-electron-provider/dist/Authenticator';  


    clientId: '<your_client_id>', 

    mainWindow: mainWindow 



You can now call Microsoft Graph and use any Microsoft Graph Toolkit components as you normally would. 

To learn more, read the documentation, try the getting started tutorial, or clone and run this sample to see it in action. 

Other improvements

This release also includes several improvements and bug fixes to the existing components and providers, including: 

  • Added support for HTML attributes and events, such as className,id, and onClick in the mgt-react package 
  • Addition of the disabled attribute and property to the People Picker component to allow read-only functionality 
  • Added support for searching across the /users endpoint in the Person component 
  • Addition of line click events to the Person Component 
  • Addition of the consistencylevel header to the Proxy Provider 

To see a full list of improvements and bug fixes, see our release notes. 

We’re looking forward to hearing your thoughts and feedback on this new release. Please submit any bugs, feature requests, and feedback by opening an issue in our Github repository. 

– The Microsoft Graph Toolkit team 

Feedback usabilla icon