14.0.0 • Published 1 year ago

@magic-sdk/react-native v14.0.0

Weekly downloads
41
License
MIT
Repository
github
Last release
1 year ago

✨ Magic Authentication JavaScript SDK

<MagicLabs>

Magic empowers developers to protect their users via an innovative, passwordless authentication flow without the UX compromises that burden traditional OAuth implementations.

Package Split!!

Since v9.0.0, @magic-sdk/react-native package drops support of bare React Native (RN). You may stay on ^v8.0.0 to keep your bare RN app functional. With this in mind, bare React Native applications utlilizing OAuth should note that @magic-ext/react-native-oauth uses expo-web-browser as a dependency.

If this dependency causes you issues, consider enabling the expo library via npx install-expo-modules@latest. For more context, you may check: https://docs.expo.dev/bare/installing-expo-modules.

This package will mainly support Expo framework in future releases.

📖 Documentation

See the developer documentation to learn how you can master the Magic SDK in a matter of minutes.

🔗 Installation

Integrating your app with Magic will require our client-side NPM package:

# Via NPM:
npm install --save @magic-sdk/react-native

# Via Yarn:
yarn add @magic-sdk/react-native

⚡️ 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';

const magic = new Magic('YOUR_API_KEY');

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

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

🙌🏾 Troubleshooting

Symlinking in Monorepo w/ Metro (Expo Only)

For React Native projects living within a monorepo that run into the following TypeError: Undefined is not an object error:

When attempting to import Magic, take note that the React Native metro bundler doesn’t work well with symlinks, which tend to be utilized by most package managers.

For this issue consider using Microsoft's rnx-kit suite of tools that include a plugin for metro that fixes this symlink related error.

12.0.0

1 year ago

14.0.0

1 year ago

13.0.0

1 year ago

11.1.0

1 year ago

11.0.0

2 years ago

10.1.0

2 years ago

10.0.1

2 years ago

10.0.0

2 years ago

9.0.0

2 years ago

8.2.1

2 years ago

8.2.0

2 years ago

8.1.0

2 years ago

8.0.0

2 years ago

6.2.1

2 years ago

7.0.0

2 years ago

6.2.0

3 years ago

6.1.2

3 years ago

6.1.1

3 years ago

6.1.4

3 years ago

6.1.3

3 years ago

6.1.0

3 years ago

6.0.6

3 years ago

6.0.5

3 years ago

6.0.4

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

6.0.3

3 years ago

6.0.2

3 years ago

6.0.0-next.1

3 years ago

6.0.0-next.0

3 years ago

5.1.0

3 years ago

5.0.0

3 years ago

4.4.2

3 years ago

4.4.1

3 years ago

4.4.0

3 years ago

4.3.1

3 years ago

4.3.0

3 years ago

4.2.1

3 years ago

4.2.0

3 years ago

4.1.1

3 years ago

4.1.0

3 years ago

4.0.1

3 years ago

4.0.2

3 years ago

4.0.0

3 years ago

3.0.1

4 years ago

3.0.1-next.0

4 years ago

3.0.0-next.0

4 years ago

2.8.0

4 years ago

2.7.1

4 years ago

2.7.0

4 years ago

2.7.0-alpha.0

4 years ago

2.6.1

4 years ago

2.6.0

4 years ago

2.5.1

4 years ago

2.5.0

4 years ago

2.4.6

4 years ago

2.4.5

4 years ago

2.4.4

4 years ago

2.4.4-alpha.0

4 years ago

2.4.1

4 years ago

2.4.3

4 years ago

2.4.2

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.3.1

4 years ago

2.2.1-alpha.0

4 years ago

2.2.0-alpha.0

4 years ago

2.1.0

4 years ago

2.0.5

4 years ago

2.0.3

4 years ago

2.0.4

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-canary.1

4 years ago

1.0.0-canary.0

4 years ago