Magic

Integrating Magic authentication with Saas UI.

This integration allows you to connect Magic with the Saas UI auth screens and provider.

Supported authentication strategies are:

  • Magic link

Installation#

yarn add magic-sdk @saas-ui/magic

Usage#

If you haven't done so already install magic-sdk.

yarn add @saas-ui/auth @saas-ui/magic magic-sdk

Setup AuthProvider#

import { Magic } from 'magic-sdk'
import { AuthProvider } from '@saas-ui/auth'
import { createAuthService } from '@saas-ui/magic'
const magic = new Magic(process.env.MAGIC_API_KEY)
function App({ children }) {
return (
<SaasProvider>
<AuthProvider {...createAuthService(magic)}>{children}</AuthProvider>
</SaasProvider>
)
}

That's it! Check the Auth documentation to see how to add authentication screens to your app.

Was this helpful?