# discord-oauth2-utils

> library for working with discord authorization

Latest version **3.0.4** (published 2025-12-12) · MIT license license · 0 weekly downloads

## Install

```sh
npm install discord-oauth2-utils
pnpm add discord-oauth2-utils
yarn add discord-oauth2-utils
bun add discord-oauth2-utils
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.4 |
| Published | 2025-12-12 |
| First published | 2022-11-03 |
| Weekly downloads | 0 |
| License | MIT license |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | ZFCStar |
| Maintainers | zoodogood, zfcstar |
| Keywords | discord, api, node, discordapp, oauth2, utils |

## Links

- npm: https://www.npmjs.com/package/discord-oauth2-utils
- Repository: https://github.com/ZFCStar/discord-oauth2-utils
- Homepage: https://github.com/ZFCStar/discord-oauth2-utils#readme
- Issues: https://github.com/ZFCStar/discord-oauth2-utils/issues
- npm.io page: https://npm.io/package/discord-oauth2-utils

## Dependencies (1)

- [undici](https://npm.io/package/undici.md) ^7.16.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 3.0.4 (latest) — 2025-12-12
- 3.0.3 — 2024-06-24
- 3.0.2 — 2024-06-24
- 3.0.1 — 2024-06-24
- 3.0.0 — 2024-06-24
- 2.1.4-0 — 2023-02-19
- 2.1.3-1 — 2023-02-19
- 2.1.3-0 — 2023-02-19
- 2.1.2-0 — 2023-02-19
- 2.1.1-9 — 2023-02-19
- 2.1.1-8 — 2023-02-19
- 2.1.1-7 — 2023-02-19
- 2.1.0 — 2023-02-19
- 0.0.3 — 2022-11-05
- 0.0.2 — 2022-11-04
- … 1 more at https://npm.io/package/discord-oauth2-utils/versions

## README

npm:  
https://www.npmjs.com/package/discord-oauth2-utils

```ts
const client = new OAuth({
  clientId,
  clientSecret,
  redirectUri,
  scopes: ["identify"],
});
const auth = client.authorizationLink();

const {access_token} = await client.requestToken(code);
const user_raw = await client.fetchUser(access_token);
const guilds_raw = await client.fetchGuilds(access_token);
```

---
_Source: https://npm.io/package/discord-oauth2-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
