supabase-rb-rb

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 install

Construct 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

Project

On this page