Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rihanarfan/deno-microsoft-graph
Use Microsoft Graph API with OAuth 2.0 client credentials grant flow in Deno
https://github.com/rihanarfan/deno-microsoft-graph
Last synced: about 1 month ago
JSON representation
Use Microsoft Graph API with OAuth 2.0 client credentials grant flow in Deno
- Host: GitHub
- URL: https://github.com/rihanarfan/deno-microsoft-graph
- Owner: RihanArfan
- License: mit
- Created: 2023-11-29T15:45:39.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-29T16:48:05.000Z (about 1 year ago)
- Last Synced: 2023-11-29T17:33:43.459Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deno-microsoft-graph
[Microsoft Graph API](https://learn.microsoft.com/en-us/graph/use-the-api) client in [Deno](https://deno.com/), with authentication via OAuth 2.0 client credentials grant flow.
Uses [`@microsoft/microsoft-graph-client`](https://www.npmjs.com/package/@microsoft/microsoft-graph-client) under the hood.
## Usage 📖
See https://www.npmjs.com/package/@microsoft/microsoft-graph-client for usage of client.
1. [Create app registration](https://learn.microsoft.com/en-us/graph/auth-v2-service) by following this guide
2. Set `TENANT_ID`, `CLIENT_ID` and `CLIENT_SECRET` environment variables in `.env````ts
// example.ts
import { client } from "https://raw.githubusercontent.com/RihanArfan/deno-microsoft-graph/v1.0.0/client.ts";
import type { User } from "npm:@microsoft/microsoft-graph-types";const users: User[] = await client.api("/users").get();
console.log(users);
``````
deno run --allow-env --allow-net --allow-read --allow-sys example.ts
```## Roadmap 🚀
- [ ] `Client` for init which accepts `tenantId`, `clientId` and `clientSecret`