Get started with the Microsoft Graph SDK for Typescript by integrating the Microsoft Graph API into your Typescript application!
Note: this SDK allows you to build applications using the v1.0 of Microsoft Graph. If you want to try the latest Microsoft Graph APIs.
Note: the Microsoft Graph Typescript SDK is currently in Pre-Release.
npm install @microsoft/msgraph-sdk-javascript
Note: we are working to add the getting started information for Typescript to our public documentation, in the meantime the following sample should help you getting started.
Register your application by following the steps at Register your app with the Microsoft Identity Platform.
An instance of the GraphServiceClient class handles building client. To create a new instance of this class, you need to provide an instance of AuthenticationProvider, which can authenticate requests to Microsoft Graph.
For an example of how to get an authentication provider, see choose a Microsoft Graph authentication provider.
You must get a GraphServiceClient object to make requests against the service.
const graphServiceClient = GraphServiceClient.init({authProvider});
After you have a GraphServiceClient that is authenticated, you can begin making calls against the service. The requests against the service look like our REST API.
To retrieve the applications's owners:
const graphServiceClient = GraphServiceClient.init({authProvider});
const result = async () => {
await graphServiceClient.applicationsById("application-id").owners.get()
}
For more detailed documentation, see:
For known issues, see issues.
The Microsoft Graph SDK is open for contribution. To contribute to this project, see Contributing.
Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license.