{"id":28524841,"url":"https://github.com/microsoftgraph/msgraph-beta-sdk-typescript","last_synced_at":"2026-01-23T00:41:20.167Z","repository":{"id":218126786,"uuid":"508472084","full_name":"microsoftgraph/msgraph-beta-sdk-typescript","owner":"microsoftgraph","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-09T17:10:42.000Z","size":50432,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-07-09T19:26:50.205Z","etag":null,"topics":["devxeng"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoftgraph.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-28T22:25:35.000Z","updated_at":"2025-07-09T17:10:38.000Z","dependencies_parsed_at":"2024-01-19T22:26:06.007Z","dependency_job_id":"aafc8034-f4db-4918-ae17-1f0dea339342","html_url":"https://github.com/microsoftgraph/msgraph-beta-sdk-typescript","commit_stats":null,"previous_names":["microsoftgraph/msgraph-beta-sdk-typescript"],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/microsoftgraph/msgraph-beta-sdk-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-beta-sdk-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-beta-sdk-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-beta-sdk-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-beta-sdk-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoftgraph","download_url":"https://codeload.github.com/microsoftgraph/msgraph-beta-sdk-typescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoftgraph%2Fmsgraph-beta-sdk-typescript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266253621,"owners_count":23900054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devxeng"],"created_at":"2025-06-09T11:11:44.299Z","updated_at":"2026-01-23T00:41:20.162Z","avatar_url":"https://github.com/microsoftgraph.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microsoft Graph SDK for Typescript\n\nGet started with the Microsoft Graph SDK for Typescript by integrating the [Microsoft Graph API](https://docs.microsoft.com/graph/overview) into your Typescript application!\n\n\u003e **Note:** this SDK allows you to build applications using the [beta](https://docs.microsoft.com/graph/use-the-api#version) of Microsoft Graph. If you want to try the latest Microsoft Graph APIs.\n\u003e\n\u003e **Note:** the Microsoft Graph Typescript SDK is currently in Pre-Release.\n\n## 1. Installation\n\n```shell\n# this will install the main package\nnpm install @microsoft/msgraph-beta-sdk\n# this will install the authentication provider for Azure Identity / Microsoft Entra\nnpm install @microsoft/kiota-authentication-azure @azure/identity\n# this will install the fluent API package for the users API paths\nnpm install @microsoft/msgraph-beta-sdk-users\n```\n\n## 2. Getting started\n\n\u003e 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.\n\n### 2.1 Register your application\n\nRegister your application by following the steps at [Register your app with the Microsoft Identity Platform](https://docs.microsoft.com/graph/auth-register-app-v2).\n\n### 2.2 Create an AuthenticationProvider object\n\nAn instance of the **GraphBetaServiceClient** 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.\n\n\u003c!-- TODO restore that and remove the snippets below once the SDK hits GA and the public documentation has been updated --\u003e\n\u003c!-- For an example of how to get an authentication provider, see [choose a Microsoft Graph authentication provider](https://docs.microsoft.com/graph/sdks/choose-authentication-providers?tabs=typescript). --\u003e\n\n#### 2.2.1 Authorization Code Provider\n\n```TypeScript\n// @azure/identity\nconst credential = new AuthorizationCodeCredential(\n  'YOUR_TENANT_ID',\n  'YOUR_CLIENT_ID',\n  'YOUR_CLIENT_SECRET',\n  'AUTHORIZATION_CODE',\n  'REDIRECT_URL',\n);\n\n// @microsoft/kiota-authentication-azure\nconst authProvider = new AzureIdentityAuthenticationProvider(credential, [\"User.Read\"]);\n```\n\n#### 2.2.2 Client Credentials Provider\n\n##### With a certificate\n\n```TypeScript\n// @azure/identity\nconst credential = new ClientCertificateCredential(\n  'YOUR_TENANT_ID',\n  'YOUR_CLIENT_ID',\n  'YOUR_CERTIFICATE_PATH',\n);\n\n// @microsoft/kiota-authentication-azure\nconst authProvider = new AzureIdentityAuthenticationProvider(credential, [\"https://graph.microsoft.com/.default\"]);\n```\n\n##### With a secret\n\n```TypeScript\n// @azure/identity\nconst credential = new ClientSecretCredential(\n  'YOUR_TENANT_ID',\n  'YOUR_CLIENT_ID',\n  'YOUR_CLIENT_SECRET',\n);\n\n// @microsoft/kiota-authentication-azure\nconst authProvider = new AzureIdentityAuthenticationProvider(credential, [\"https://graph.microsoft.com/.default\"]);\n```\n\n#### 2.2.3 On-behalf-of provider\n\n```TypeScript\n// @azure/identity\nconst credential = new OnBehalfOfCredential({\n  tenantId: 'YOUR_TENANT_ID',\n  clientId: 'YOUR_CLIENT_ID',\n  clientSecret: 'YOUR_CLIENT_SECRET',\n  userAssertionToken: 'JWT_TOKEN_TO_EXCHANGE',\n});\n\n// @microsoft/kiota-authentication-azure\nconst authProvider = new AzureIdentityAuthenticationProvider(credential, [\"https://graph.microsoft.com/.default\"]);\n```\n\n#### 2.2.4 Device code provider\n\n```TypeScript\n// @azure/identity\nconst credential = new DeviceCodeCredential({\n  tenantId: 'YOUR_TENANT_ID',\n  clientId: 'YOUR_CLIENT_ID',\n  userPromptCallback: (info) =\u003e {\n    console.log(info.message);\n  },\n});\n\n// @microsoft/kiota-authentication-azure\nconst authProvider = new AzureIdentityAuthenticationProvider(credential, [\"User.Read\"]);\n```\n\n#### 2.2.5 Interactive provider\n\n```TypeScript\n// @azure/identity\nconst credential = new InteractiveBrowserCredential({\n  tenantId: 'YOUR_TENANT_ID',\n  clientId: 'YOUR_CLIENT_ID',\n  redirectUri: 'http://localhost',\n});\n\n// @microsoft/kiota-authentication-azure\nconst authProvider = new AzureIdentityAuthenticationProvider(credential, [\"User.Read\"]);\n```\n\n#### 2.2.6 Username/password provider\n\n```TypeScript\n// @azure/identity\nconst credential = new UsernamePasswordCredential(\n  'YOUR_TENANT_ID',\n  'YOUR_CLIENT_ID',\n  'YOUR_USER_NAME',\n  'YOUR_PASSWORD',\n);\n\n// @microsoft/kiota-authentication-azure\nconst authProvider = new AzureIdentityAuthenticationProvider(credential, [\"User.Read\"]);\n```\n\n### 2.3 Get a Graph Service Client Adapter object\n\nYou must get a **GraphServiceClient** object to make requests against the service.\n\n```typescript\nconst requestAdapter = new FetchRequestAdapter(authProvider);\nconst graphServiceClient = createGraphServiceClient(requestAdapter);\n```\n\nYou must get a **GraphBetaServiceClient** object to make requests against the service.\n\n```typescript\nconst requestAdapter = new FetchRequestAdapter(authProvider);\nconst graphBetaServiceClient = createGraphBetaServiceClient(requestAdapter);\n```\n\n## 3. Make requests against the service\n\nAfter you have a **GraphBetaServiceClient** that is authenticated, you can begin making calls against the service. The requests against the service look like our [REST API](https://docs.microsoft.com/graph/api/overview?view=graph-rest-1.0).\n\n### 3.1 Get user's detailed information\n\nTo retrieve the user's detailed information:\n\n```typescript\nimport { FetchRequestAdapter } from \"@microsoft/kiota-http-fetchlibrary\";\nimport { createGraphBetaServiceClient } from \"@microsoft/msgraph-beta-sdk\";\nimport \"@microsoft/msgraph-beta-sdk-users\";\n\nconst requestAdapter = new FetchRequestAdapter(authProvider);\nconst graphBetaServiceClient = createGraphBetaServiceClient(requestAdapter);\n\nconst jane = await graphBetaServiceClient.users.byUserId(\"jane@contoso.com\").get();\n```\n\n## 4. Documentation\n\nFor more detailed documentation, see:\n\n* [Overview](https://docs.microsoft.com/graph/overview)\n* [Collections](https://docs.microsoft.com/graph/sdks/paging)\n* [Making requests](https://docs.microsoft.com/graph/sdks/create-requests)\n* [Known issues](https://github.com/MicrosoftGraph/msgraph-beta-sdk-typescript/issues)\n* [Contributions](https://github.com/microsoftgraph/msgraph-beta-sdk-typescript/blob/main/CONTRIBUTING.md)\n\n## 5. Issues\n\nFor known issues, see [issues](https://github.com/MicrosoftGraph/msgraph-beta-sdk-typescript/issues).\n\n## 6. Contributions\n\nThe Microsoft Graph SDK is open for contribution. To contribute to this project, see [Contributing](https://github.com/microsoftgraph/msgraph-beta-sdk-typescript/blob/main/CONTRIBUTING.md).\n\n## 7. License\n\nCopyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the [MIT license](LICENSE).\n\n## 8. Third-party notices\n\n[Third-party notices](THIRD%20PARTY%20NOTICES)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoftgraph%2Fmsgraph-beta-sdk-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoftgraph%2Fmsgraph-beta-sdk-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoftgraph%2Fmsgraph-beta-sdk-typescript/lists"}