Supabase Rails (supabase-rails)
supabase-rails is a Supabase integration for Ruby on Rails — supabase-rb on Rails, packaged as a Railtie with Rails Supabase auth (sign-in, sign-up, OAuth, password reset, OTP), generators, view templates, and an encrypted-cookie session store.
supabase-rails is the Ruby on Rails integration for Supabase — supabase-rb on Rails, packaged as a Railtie with built-in Rails Supabase auth. It wires the supabase-rb client into Rails, ships a drop-in Authentication concern with controllers, views, and generators for sign-in, sign-up, OAuth, password reset, and OTP, and provides an encrypted-cookie session store so browser sessions Just Work without a separate user table.
Use this Supabase Rails gem when you want first-party Rails Supabase auth without bolting supabase-js onto the front end, or when your Rails-8 app already expects the bin/rails generate authentication shape and you want Supabase as the identity provider behind it.
Start here
Install in 5 minutes
bundle add supabase-rails, rails g supabase:install, set SUPABASE_URL — and your first authenticated request.
Generators
supabase:install, supabase:user_model, and supabase:views — what each generator copies into your app.
Explore the reference
Configuration
config.supabase.* Railtie keys, environment variables, CORS, logging, and middleware setup.
Authentication
The Supabase::Rails::Authentication concern, request context, JWT verification, and error codes.
Web mode
Per-request auth clients, encrypted cookie sessions, PKCE storage, and the refresh coordinator.
Controllers
Sessions, registrations, passwords, OTP, and OAuth controllers plus the routes DSL.
Views
Default view templates shipped by the gem and how to override them in your app.
Project
- Source:
supabase-community/supabase-rails - Ruby client reference:
supabase-rbdocs - Issues: the gem's issue tracker