# @magic-ext/oauth

> Magic SDK OAuth Extension for Web environments.

Latest version **24.0.0** (published 2025-09-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @magic-ext/oauth
pnpm add @magic-ext/oauth
yarn add @magic-ext/oauth
bun add @magic-ext/oauth
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 24.0.0 |
| Published | 2025-09-03 |
| First published | 2020-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 142.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (Unknown) |
| GitHub stars | 476 |
| Author | Magic |
| Maintainers | seanli, damianjachyra, ethella, hcote, mikeysight, jasonatmagic, magiclabs_fe, jonathansoper, khaledali.magic, ritalestermagic, dizigen, jmac-magic, noahyoshida, jfifer-b9s, josh_scanlan |

## Links

- npm: https://www.npmjs.com/package/@magic-ext/oauth
- Repository: https://github.com/magiclabs/magic-js
- Homepage: https://github.com/magiclabs/magic-js#readme
- Issues: https://github.com/magiclabs/magic-js/issues
- npm.io page: https://npm.io/package/@magic-ext/oauth

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.2.0

## Recent versions

- 24.0.0 (latest) — 2025-09-03
- 24.0.0-canary.879.17443815749.0 (canary) — 2025-09-03
- 24.0.0-canary.879.17443711181.0 — 2025-09-03
- 24.0.0-canary.915.17279636506.0 — 2025-08-27
- 24.0.0-canary.915.17279247601.0 — 2025-08-27
- 24.0.0-canary.915.17276855001.0 — 2025-08-27
- 23.4.3-canary.938.17273935610.0 — 2025-08-27
- 24.0.0-canary.915.17273532968.0 — 2025-08-27
- 24.0.0-canary.915.17251352750.0 — 2025-08-26
- 24.0.0-canary.915.17249931426.0 — 2025-08-26
- 24.0.0-canary.915.17249684892.0 — 2025-08-26
- 24.0.0-canary.915.17249441564.0 — 2025-08-26
- 24.0.0-canary.915.17248955237.0 — 2025-08-26
- 24.0.0-canary.915.17247494507.0 — 2025-08-26
- 24.0.0-canary.915.17110143296.0 — 2025-08-20
- … 937 more at https://npm.io/package/@magic-ext/oauth/versions

## README

# 🔒 Magic OAuth Extension for Web Browsers

> We suggest use OAUTH2 `@magic-ext/oauth2` package for the best performance

[![<MagicLabs>](https://circleci.com/gh/magiclabs/magic-js.svg?style=shield)](https://circleci.com/gh/magiclabs/magic-js)

> With the Magic JavaScript SDK OAuth extension, you can plug into your favorite social login providers with one, easy-to-use API.

<p align="center">
  <a href="https://github.com/magiclabs/magic-js/blob/master/packages/@magic-ext/oauth/LICENSE">License</a> ·
  <a href="https://github.com/magiclabs/magic-js/blob/master/packages/@magic-ext/oauth/CHANGELOG.md">Changelog</a> ·
  <a href="https://github.com/magiclabs/magic-js/blob/master/CONTRIBUTING.md">Contributing Guide</a>
</p>

## 📖 Documentation

See the [developer documentation](https://magic.link/docs/authentication/login/social-logins/oauth-implementation) to learn how to get started with OAuth in Magic SDK.

## 🔗 Installation

Integrating your app with OAuth will require our client-side NPM package and OAuth extension:

```bash
# Via NPM:
npm install --save magic-sdk @magic-ext/oauth

# Via Yarn:
yarn add magic-sdk @magic-ext/oauth
```

Alternatively, you can load via CDN with by adding a script tag to your app’s `<head>`:

```html
<script src="https://cdn.jsdelivr.net/npm/magic-sdk/dist/magic.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@magic-ext/oauth/dist/extension.js"></script>
```

## ⚡️ Quick Start

Sign up or log in to the [developer dashboard](https://dashboard.magic.link) to receive API keys that will allow your application to interact with Magic's authentication APIs.

Then, you can start authenticating users with _just two method calls!_

From your login page:

```ts
import { Magic } from 'magic-sdk';
import { OAuthExtension } from '@magic-ext/oauth';

const magic = new Magic('YOUR_API_KEY', {
  extensions: [new OAuthExtension()]
});

await magic.oauth.loginWithRedirect({
  provider: 'google' | 'facebook' | 'github' | ...
});
```

From your OAuth callback page:

```ts
import { Magic } from 'magic-sdk';
import { OAuthExtension } from '@magic-ext/oauth';

const magic = new Magic('YOUR_API_KEY', {
  extensions: [new OAuthExtension()]
});

const res = await magic.oauth.getRedirectResult();

// Then you can access a user's Magic DID token, OAuth access token,
// OpenID Connect profile information, and more!
res.magic.idToken;
res.oauth.accessToken;
res.oauth.userInfo;
```

---
_Source: https://npm.io/package/@magic-ext/oauth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
