9.16.0 โ€ข Published 8 months ago

@magic-ext/oauth2 v9.16.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

๐Ÿ”’ Magic OAuth Extension for Web Browsers

<MagicLabs>

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

๐Ÿ“– Documentation

See the developer documentation 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 2 extension:

# Via NPM:
npm install --save magic-sdk @magic-ext/oauth2

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

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

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

โšก๏ธ Quick Start

Sign up or log in to the developer dashboard 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:

import { Magic } from 'magic-sdk';
import { OAuthExtension } from '@magic-ext/oauth2';

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

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

From your OAuth callback page:

import { Magic } from 'magic-sdk';
import { OAuthExtension } from '@magic-ext/oauth2';

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

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

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

8 months ago

9.15.0

8 months ago

9.14.0

8 months ago

9.13.0

8 months ago

9.12.0

8 months ago

9.11.0

9 months ago

9.10.0

9 months ago

9.8.0

9 months ago

9.9.0

9 months ago

9.7.0

9 months ago

9.6.0

10 months ago

9.0.6

12 months ago

9.0.5

1 year ago

9.0.4

1 year ago

9.0.3

1 year ago

9.2.1

11 months ago

9.1.0

11 months ago

9.3.0

10 months ago

9.2.0

11 months ago

9.4.0

10 months ago

9.5.0

10 months ago

9.0.2

1 year ago

9.0.1

1 year ago

9.0.0

1 year ago

8.0.0

1 year ago

7.0.0

1 year ago

6.0.0

1 year ago

5.0.0

1 year ago

3.0.0

1 year ago

4.0.0

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago

0.1.0

1 year ago