File tree Expand file tree Collapse file tree
packages/msgraph-sdk-admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,29 +26,10 @@ npm install @microsoft/msgraph-sdk-admin
2626Here is an example of how to use the package:
2727
2828``` typescript
29- import { createGraphServiceClient , GraphRequestAdapter } from " @microsoft/msgraph-sdk" ;
30- import { AzureIdentityAuthenticationProvider } from " @microsoft/kiota-authentication-azure" ;
31- import { ClientSecretCredential } from " @azure/identity" ;
3229import " @microsoft/msgraph-sdk-admin"
3330
34- // Create a credential using ClientSecretCredential
35- const credential = new ClientSecretCredential (
36- ' YOUR_TENANT_ID' ,
37- ' YOUR_CLIENT_ID' ,
38- ' YOUR_CLIENT_SECRET' ,
39- );
40-
41- // Create an authentication provider
42- const authProvider = new AzureIdentityAuthenticationProvider (credential , [" https://graph.microsoft.com/.default" ]);
43-
44- // Create a request adapter
45- const requestAdapter = new GraphRequestAdapter (authProvider );
46-
47- // Create a GraphServiceClient
48- const graphServiceClient = createGraphServiceClient (requestAdapter );
49-
5031// Use the GraphServiceClient to make requests by including the appropriate API calls package
51- // e.g graphServiceClient.admin.(complete your call)
32+ const admin = graphServiceClient .admin .get ();
5233
5334```
5435
You can’t perform that action at this time.
0 commit comments