๐ Magic OAuth Extension for React Native (Expo)
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:
npm install --save @magic-ext/react-native-expo-oauth
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>
</>
}
await magic.auth.loginWithEmailOTP({ email: 'your.email@example.com' });
โ โ ๐ Check out some of our React Native Demo apps for inspiration! ๐