@insforge/react package provides authentication for React+Vite applications using hosted auth pages.
When users sign in, they’re redirected to your InsForge backend’s login page, then returned to your app after authentication—no UI code required.
Quick Start
Step 1: Create New React Project (Required)
Step 2: Set Environment Variables
.env
Step 3: Setup Provider
Wrap your app withInsforgeProvider in the root:
src/main.tsx
Step 4: Use Hooks & Components
src/pages/Home.tsx
Next Steps
Hooks
useAuth()
Access authentication state:
isSignedIn- Boolean auth stateisLoaded- Boolean loading state
useUser()
Access current user data:
user- User object with id, email, profileuser.profile- User profile object with name, avatar_url, and other custom fieldsisLoaded- Boolean loading state