Supabase

Integrating Supabase authentication with Saas UI.

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

Supported authentication strategies are:

  • Magic link
  • Password
  • Social login (Oauth)

install#

yarn add @saas-ui/supabase @supabase/supabase-js

Import#

import { createAuthService } from '@saas-ui/supabase'

Usage#

If you haven't done so already install @supabase/supabase-js.

yarn add @saas-ui/auth @saas-ui/supabase @supabase/supabase-js

Setup AuthProvider#

import { createClient } from '@supabase/supabase-js'
import { AuthProvider } from '@saas-ui/auth'
import { createAuthService } from '@saas-ui/supabase'
const supabaseClient = createClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_KEY
)
function App({ children }) {
return (
<SaasProvider>
<AuthProvider {...createAuthService(supabaseClient)}>
{children}
</AuthProvider>
</SaasProvider>
)
}

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

Was this helpful?