How to use the Supabase Client in the React Native Supabase kit
To use the Supabase Client in the React Native Supabase kit, use the useSupabase hook in React Components
Before diving into the various ways we can communicate with the server, we need to introduce how we communicate with Supabase, which is hosting the database and therefore the source of our data.
Using the Supabase client
To import the Supabase client in a browser environment, you can use the useSupabase
hook:
import { useSupabase } from '@kit/supabase';export default function Home() { const supabase = useSupabase() return ( <div> <h1>Supabase Browser Client</h1> <button onClick={() => supabase.auth.signOut()}>Sign Out</button> </div> )}