Supabase Ruby & Rails client (supabase-rb)
supabase-rb is the Ruby and Rails client for Supabase — Auth, Database (PostgREST), Realtime, Storage, and Edge Functions behind one Supabase::Client.
supabase-rb is the Ruby client for Supabase and works in any Ruby or Ruby on Rails app. It bundles every Supabase product — Auth (GoTrue), Database (PostgREST), Realtime, Storage, and Edge Functions — behind a single Supabase::Client.
Quickstart
Add the gem to your Gemfile:
# Gemfile
gem "supabase-rb"Then install:
bundle installConstruct a client and run a first query:
require "supabase"
supabase = Supabase.create_client(
supabase_url: ENV.fetch("SUPABASE_URL"),
supabase_key: ENV.fetch("SUPABASE_ANON_KEY")
)
response = supabase.from("countries").select("*").limit(1).execute
puts response.data
# => [{"id" => 1, "name" => "United Kingdom"}]SUPABASE_URL is your project URL (e.g. https://abcd1234.supabase.co); SUPABASE_ANON_KEY is the anon key from your project's API settings. Requires Ruby ≥ 3.1.
For the full constructor surface — ClientOptions, schema selection, async mode, the legacy nested-hash form — see Initializing.
Explore the reference
Initializing
Install the gem, construct a client, configure ClientOptions, opt into async mode.
Auth
Sign-in / sign-up, sessions, MFA, identities, and admin user management.
Database
PostgREST query builder — from, select, insert, filters, modifiers, and rpc.
Realtime
Channels, Postgres change subscriptions, broadcast, and presence.
Storage
Bucket admin API and file operations — upload, download, signed URLs.
Edge Functions
Invoke deployed Edge Functions with body, headers, region, and response decoding.
Project
- Source:
supabase-community/supabase-rb - Issues: the gem's issue tracker