Skip to main content

supabase-common

npm version npm downloads Bundle size License: MIT

Small, focused helpers for working with Supabase and PostgREST results — part of the @rtorcato/* family.

  • Zero runtime dependencies — helpers operate on the plain { data, error } shape every Supabase call returns, so the package works with any @supabase/supabase-js version without depending on it.
  • ESM-only, tree-shakeablesideEffects: false, fully typed, targets Node.js ≥22.
  • Just the ergonomics — stop writing if (error) throw error on every call.
Early days

The public API is still small and may change before 1.0. See the milestones for what's planned.

Quick example

import { unwrap } from '@rtorcato/supabase-common'

// Throws SupabaseError on error, returns the row otherwise.
const user = unwrap(await supabase.from('users').select().eq('id', id).single())

Next: install it and read the usage guide.