GoTrue is the auth server that powers Supabase. It handles user registration, login, JWT tokens, and session management. Originally built by Netlify, now maintained by Supabase. You can find the complete API documentation and self-hosting guide in their docs.
Here's the real shit: it works well with PostgreSQL's Row Level Security, which is actually useful unlike most auth integrations that require you to roll your own access control.
What GoTrue Actually Does
JWT Token Handling: Issues standard JWT tokens that don't randomly break like some auth services I won't name. Configurable expiration, custom claims for RBAC. The tokens actually work.
Authentication Methods:
- Email/password (with sane password policies you can actually configure)
- Magic links (passwordless login that works most of the time)
- OAuth with 20+ providers - Google, GitHub, Apple, Discord, etc.
- SMS OTP (when your SMS provider isn't down)
- Anonymous sessions for guest users
PostgreSQL Integration: This is where GoTrue shines. It integrates with PostgreSQL's Row Level Security so you can do access control at the database level instead of writing brittle application logic.
-- Users can only see their own data - enforced by the database
CREATE POLICY "users_own_data" ON profiles
FOR ALL USING (auth.uid() = user_id);
-- Different levels of access
CREATE POLICY "users_read_public" ON profiles
FOR SELECT USING (is_public = true);
-- Time-based access control
CREATE POLICY "users_edit_recent" ON posts
FOR UPDATE USING (
auth.uid() = user_id
AND created_at > now() - interval '1 hour'
);
The auth.uid()
function extracts the user ID from the JWT automatically. No more checking tokens in your application code. But here's the magic: this happens at the database level, so even if your application has bugs, users can't access data they shouldn't see. It's like having a security guard at every table.
Real-World Architecture
GoTrue is a stateless Go service that connects to PostgreSQL. In production, you'll want:
- Multiple GoTrue instances behind a load balancer (because shit breaks)
- PostgreSQL connection pooling with PgBouncer or similar
- Proper monitoring because you'll need it when things go wrong
- Rate limiting configured properly (default limits are too permissive)
The service works with PostgREST for API generation and Realtime for WebSockets. You can also integrate with PgBouncer for connection pooling and Prometheus for monitoring. Check out the production architecture examples and customer case studies for real-world implementations.
Cost Reality Check
Here's what you'll actually pay as of September 2025 (and why your CFO will either love you or fire you):
Supabase (includes GoTrue):
- Free: 50,000 MAU (good for prototypes)
- Pro: $25/month for 100,000 MAU
- Overage: $0.00325 per MAU
Auth0:
- Essentials: $35/month for 500 MAU (already expensive for a side project)
- Professional: $240/month for 1,000 MAU (starts hurting real quick)
- Enterprise: $23,000+ annually (Auth0 hit us with some massive unexpected bill, think it was like $3,000 or something crazy, turns out they were counting password resets as active users which is complete bullshit)
Firebase Auth: Google's pricing calculator is designed to confuse you, but expect $150-300/month for 100K MAU.
Self-Hosting vs Managed
Self-hosting benefits:
- Your data stays on your servers
- No vendor lock-in bullshit
- Deploy wherever you want
- Customize everything
Self-hosting downsides:
- You're responsible for security updates
- No SLA unless you build it yourself
- Monitoring and alerting is your problem
- When it breaks at 3am, you fix it
Managed service benefits:
- Supabase handles the operational stuff
- 99.9% uptime SLA (when it works)
- Built-in monitoring and logs
- Someone else gets called at 3am
Some companies like Mobbin and Good Tape migrated from Firebase/Auth0 to save money. Read the migration guides and check out discussions on Hacker News for real migration experiences. Also see Reddit discussions where developers share their experiences with costs and complexity.
But before you get excited about the cost savings, you need to understand how GoTrue stacks up against the competition. Let's compare the real differences.