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.

  • Dependency-free core — the root helpers operate on the plain { data, error } shape every Supabase call returns, so they work with any @supabase/supabase-js version without importing it.
  • Optional /client subpath — framework-agnostic client factories behind @supabase/ssr / @supabase/supabase-js peer deps (no Next.js dependency — SSR callers pass their own cookie adapter).
  • 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.