react-supabase-auth-template
react-supabase-auth-template copied to clipboard
React Supabase Auth Starter Template with Protected Routes
React Supabase Auth with Protected Routes
Features
- π Protected Routes
- π Supabase Session Object in Global Context via
useSession - π User Authentication
- π Routing and Route Guards
It's also blazingly fast π₯ No really, try it out for yourself.
We also have a similar template for FIREBASE π₯
Getting Started
- Clone the repository
- Install dependencies:
npm install - Create
.envusing the.env.exampleas a template
VITE_SUPABASE_URL=
VITE_SUPABASE_ANON_KEY=
- Run the app:
npm run dev
What you need to know
/router/index.tsxis where you declare your routes/context/SessionContext.tsxis where you can find theuseSessionhook- This hook gives you access to the
sessionobject from Supabase globally
- This hook gives you access to the
/Providers.tsxis where you can add moreprovidersorwrappers