@magic-ext/react-native-expo-oauth
TypeScript icon, indicating that this package has built-in type declarations

25.0.2 • Public • Published

🔒 Magic OAuth Extension for React Native (Expo)

<MagicLabs>

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

License · Changelog · Contributing Guide

📖 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 extension:

# Via NPM:
npm install --save @magic-ext/react-native-expo-oauth

# Via Yarn:
yarn add @magic-ext/react-native-expo-oauth

⚠️ This library can only be used on an Expo project that uses @magic-sdk/react-native-expo.

⚡️ 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 one method!

import React from 'react';
import { Magic } from '@magic-sdk/react-native-expo';
import { OAuthExtension } from "@magic-ext/react-native-expo-oauth";
import { SafeAreaProvider } from 'react-native-safe-area-context';

const magic = new Magic(apiKey, {
    endpoint: 'https://box.magic.link',
    extensions: [
        new OAuthExtension()
    ],
});

export default function App() {
    return <>
        <SafeAreaProvider>
            {/* Render the Magic iframe! */}
            <magic.Relayer />
            {...}
        </SafeAreaProvider>
    </>
}

// Somewhere else in your code...
await magic.auth.loginWithEmailOTP({ email: 'your.email@example.com' });

⁠⁠👉 Check out some of our React Native Demo apps for inspiration! 👀

Readme

Keywords

none

Package Sidebar

Install

npm i @magic-ext/react-native-expo-oauth

Weekly Downloads

311

Version

25.0.2

License

MIT

Unpacked Size

77.1 kB

Total Files

13

Last publish

Collaborators

  • ritalestermagic
  • darrentmagic
  • romin-halltari
  • magictristan
  • musicbender
  • jay.hwang
  • benmagic
  • dizigen
  • sgdheeban
  • mikeysight
  • ethella
  • damianjachyra
  • magiclabs_fe
  • jasonatmagic
  • bcleary06
  • hcote
  • seanli