Supabase packages
Which Supabase packages better-supabase builds on, how each one is installed and which docs page covers it.
better-supabase adds types and glue on top of Supabase's own packages; it replaces none of them. This page lists every Supabase package it touches, how it gets into your app and where it is documented. Peers lists the version range of every peer.
Runtime packages
These run in your app. Only the first four are dependencies of
better-supabase; you install @supabase/supabase-js yourself.
| Package | What better-supabase uses it for | How it is installed | Docs |
|---|---|---|---|
@supabase/server | Verifies access tokens locally, defines the claim, auth-mode and env types, and builds the RFC 9728 metadata for MCP servers | Dependency | Auth |
@supabase/middleware | The request pipeline (ctx.supabase, ctx.postgres) and the bridge for each framework | Dependency | Middleware |
@supabase/ssr | The browser client and the session cookie format | Dependency | Auth |
@supabase/postgrest-js | A bare PostgREST client for ctx.db when no shared supabase-js client is passed | Dependency | Repository |
@supabase/supabase-js | Per-request user, anon and service clients, Storage, Realtime and the auth admin calls | Required peer | Quickstart |
supabase-js brings the service clients along. better-supabase never imports them directly; it reaches each one through the supabase-js client:
| Package | Reached through | Docs |
|---|---|---|
@supabase/auth-js | client.auth (sign-in helpers, auth.admin for account deletion and suspension) | Auth |
@supabase/storage-js | client.storage (typed buckets, analytics and vector buckets) | Storage |
@supabase/realtime-js | client.channel (typed topics, presence and live queries) | Realtime |
@supabase/functions-js | functions() in better-supabase/client, the typed calls to defineFunction handlers | Edge Functions |
@supabase/gotrue-js is the old name of @supabase/auth-js and is
deprecated; don't install it next to supabase-js. @supabase/shared-types is
an internal Supabase package, and better-supabase doesn't use it.
CLI packages
better-supabase gen and the other commands load these only when they need
them. Apps that only run the runtime entries never install them.
| Package | What the CLI uses it for | How it is installed | Docs |
|---|---|---|---|
@supabase/postgrest-typegen | Reads the database catalog and writes database.types.ts, the same file supabase gen types writes | Optional peer (>=0.4.0 <0.5, tested against 0.4.0) | gen |
@supabase/config | Interpolates env() in supabase/config.toml the way the Supabase CLI does; without it, smol-toml parses the file | Optional peer | Config |
Supabase's MCP server
| Package | What better-supabase uses it for | How it is installed | Docs |
|---|---|---|---|
@supabase/mcp-server-supabase | The tool schemas supabaseMcp() types an agent's tools with, and the server supabaseMcpHandler() serves | Optional peer (>=0.13.0 <0.14) | MCP connectors, MCP |
The Supabase CLI
The supabase CLI runs your local
stack, and better-supabase works next to it rather than wrapping it:
better-supabase genwrites the samedatabase.types.tsassupabase gen types, through@supabase/postgrest-typegen, and adds its own files next to it. It reads the schema overpg, so it doesn't call the Supabase CLI.better-supabase envrunssupabase statusto read the local URLs and keys. It uses$SUPABASE_BINwhen set, thensupabaseon thePATH, thennpx supabase.better-supabase initprints thesupabasecommands to run next (supabase start,supabase db reset).
See Local development for the commands and their output.
Last updated on