Supabase-ui login component in Streamlit

Hello all,

Curious to see if anyone has tried to use supabase-ui as a login page for Streamlit?


import { Auth, Typography, Button } from "@supabase/ui";
import { createClient } from "@supabase/supabase-js";

const { Text } = Typography

// Create a single supabase client for interacting with your database
const supabase = createClient(

const Container = (props) => {
  const { user } = Auth.useUser();
  if (user)
    return (
        <Text>Signed in: {}</Text>
        <Button block onClick={() => props.supabaseClient.auth.signOut()}>
          Sign out
  return props.children;

export default function Home() {
  return (
    <Auth.UserContextProvider supabaseClient={supabase}>
      <Container supabaseClient={supabase}>
        <Auth providers={['google']} supabaseClient={supabase}/>

export default withStreamlitConnection(Home())

I am completely stuck here as to how I would import this js file into my file . I have consulted How to Build a Streamlit Component tutorials on Youtube but emerged none the wiser (the presenter was using React.js)

I was looking into the same problem over the weekend. There are some nuances with embedding supabase-js within an iframe. So I ended up creating a custom component to patch a few internal functions used by supabase-js library.

Feel free to try out my example here streamlit-supabase-auth · PyPI. Once the user successfully authenticates, a session object will be returned to streamlit python app.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.