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


import { createAuthService } from '@saas-ui/auth/services/magic'


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

yarn add magic-sdk

Setup AuthProvider#

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

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

Was this helpful?