Overview
Conformly.ai uses Supabase JWT tokens for authentication. All API requests (except payment endpoints) require a valid token in the Authorization header.
Base URL
Production:
Local Development:
Endpoints
Get Current User Profile
Returns the authenticated user’s profile including subscription status.
Response:
Sync User Profile
Called by the frontend on every session load. Handles two scenarios:
- Pending subscription: If the user paid via Stripe before signing up, migrates the
pending_subscription into their profile.
- No subscription: Activates the free plan automatically (sets
subscription_status = 'active', subscription_plan = 'free').
Response:
Refresh JWT Token
Response:
Subscription Flow
Error Responses
401 Unauthorized:
402 Payment Required (when using check_active_subscription dependency):
Frontend Integration
The ProtectedRoute component handles the full auth + subscription flow:
Never call supabase.auth.getSession() or refreshSession() from inside an onAuthStateChange callback. The Supabase client holds an internal lock during event dispatch, and nested calls will deadlock.