Overview
BrokerOS uses Better Auth for all authentication. There are no custom JWT flows or API keys for regular users — authentication is session-based. Base auth path:POST /api/auth/*
Sign In
better-auth.session_token HttpOnly cookie automatically. Web browsers use this cookie for all subsequent requests.
Sign Out
200 OK with no body.
Get Current Session
401 if no valid session exists.
Using Sessions in API Calls
Browser / Web App
The session cookie is set automatically. Allfetch calls include it if you use credentials: 'include':
Mobile App (Expo)
The Better Auth Expo plugin handles cookie storage inexpo-secure-store. All API calls from authClient.$fetch are automatically authenticated.
Scripts & Backend-to-Backend
Pass the session token in theAuthorization header: