• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
    • Introduction
    • Clone the Repository
    • Running the Project
    • Common Commands
    • Updating the Codebase
    • LLMs rules
    • Database
    • Supabase Client
    • React Query

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:

tsx
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>
)
}
On this page
  1. Using the Supabase client