Scan your whole stack
From OX Research Newsroom
Are you using better-supabase?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.94.0
better-supabase was last scanned on 30 Nov 2026 at version 0.94.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.94.0 LATEST | 30 Nov 2026 | No rules fired |
| 0.92.0 | 29 Nov 2026 | No rules fired |
| 0.91.1 | 27 Nov 2026 | No rules fired |
| 0.91.0 | 27 Nov 2026 | Not shown |
| 0.90.0 | 27 Nov 2026 | Not shown |
Findings for v0.94.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.94.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A typed data layer for Supabase: generated repositories that return Results and run under RLS, auth helpers, framework adapters and a CLI.
Docs · Quickstart · Blocks · Examples · Changelog · GitHub
better-supabase sits on the supabase-js client you already use. You keep your database, your RLS policies, Supabase Auth and Storage. The CLI reads your schema and generates a typed repository for every table, so a query is a typed object instead of a string. It is an independent, MIT-licensed project built on the official Supabase packages, not a Supabase product, and the raw client stays one property away as db.$client.
With supabase-js, the columns and relations are a string, a filter on a related table needs !inner and a dotted path, and the error is a Postgres or PostgREST code:
const { data, error } = await supabase
.from("customers")
.select("id, name, organization(name), notes!inner(kind)")
.eq("status", "active")
.eq("notes.kind", "call")
.order("name")
.limit(20);
if (error) throw error;
With better-supabase, the same read is an object the compiler checks, the row type follows from select and include, and the call returns a Result instead of throwing:
const result = await db.customers.list({
select: ["id", "name"],
where: { status: "active", notes: { some: { kind: "call" } } },
include: { organization: { select: ["name"] } },
orderBy: { name: "asc" },
limit: 20,
});
if (!result.ok) {
// result.error.kind is "unauthorized", "timeout", "network" and so on
return Response.json(result.error, { status: result.error.status });
}
result.data; // { id: string; name: string; organization: { name: string } }[]
It is still one PostgREST request, and it runs as the signed-in user, so your RLS policies decide what it can read. Call .orThrow() when you would rather throw. The supabase-js migration guide maps every supabase-js call to its repository equivalent.
| Feature | What it does |
|---|---|
| Stronger generated types | gen writes the same database.types.ts as supabase gen types, and adds relationship cardinality, unique keys, CHECK-constraint unions, typed jsonb and per-table flags. |
| A typed repository | list, get and the writes take where, include, orderBy and pagination, and compile to one PostgREST request, or to SQL on the direct-Postgres path. |
| Results, not exceptions | Every call returns a Result with a plain, serializable DbError, safe to return from server actions and RPC handlers. |
| Queries as the caller | connect() runs per request with the user's client, so every query runs under their RLS policies. Rows keep your casing, snake_case or camelCase. |
| Auth without round trips | A valid access token is verified locally and never reaches the Auth server. Refresh happens once, in the proxy. |
| Caches that follow writes | Writes invalidate the cache tags of the tables they touch, and the generated data hooks refetch. |
| Checks before you ship | doctor reports missing RLS, grants and indexes, config and env drift, and the Supabase advisors. |
| Blocks of SQL you own | A block renders tables, policies and functions into your repository for features most apps build by hand. |
Install the package, and the two optional peers the CLI loads:
pnpm add better-supabase @supabase/supabase-js
pnpm add -D pg @supabase/postgrest-typegen@0.8.1
Write the config, src/lib/supabase and the glue for the frameworks it finds:
pnpm better-supabase init
Start the local stack, write its URL and keys to .env.local, and generate the types:
supabase start
pnpm better-supabase dev env
pnpm better-supabase gen
Define the app once, and create the server instance for your framework. On Next.js:
import { createSupabase } from "better-supabase";
import { schema } from "./generated-schema.ts";
export const betterSupabase = createSupabase(schema);
import "server-only";
import { createNext } from "better-supabase/next";
import { betterSupabase } from "./index";
export const bsb = createNext(betterSupabase);
Query as the caller from a Server Component, route handler or server action:
const { db } = await bsb.context();
const customers = await db.customers
.list({ where: { status: "active" }, limit: 20 })
.orThrow();
Run better-supabase gen --check in CI to fail when the schema and the generated files drift apart. The Quickstart has each step in full.
| Requirement | Version |
|---|---|
| Node.js | 24 or later for the CLI |
| Runtimes | The runtime entries import no Node built-ins and run on every WinterTC runtime; cli, node, nestjs, postgres and testing need Node |
| TypeScript | 6 and 7, with nodenext or bundler module resolution |
| Module format | ESM only |
| Peers | @supabase/supabase-js; every other peer is optional and listed per subpath on Peers |
Every step is optional and reversible, and you can stop on any of them:
better-supabase init writes a config with no blocks and no SQL, and changes nothing in the database.better-supabase gen types the tables you already have: repositories, validators and hooks.better-supabase table <t> enable <feature> turns on realtime, audit, search or subjects for one table, through a tag in its comment.better-supabase add <block> --over <table> renders a block's files over a table you own.better-supabase add --preset <name> installs whole products next to your tables.Old supabase.from() calls keep working next to the repositories, so you can move one query at a time. See Existing apps.
An adapter runs in the framework's own middleware or hook. It verifies the access token locally against the project's JWKS, which it fetches once and caches. While the token is valid it writes no cookies, and an expiring session is refreshed once, in the proxy. Every route, loader and action then gets a db for the caller.
| Where you run | Adapters |
|---|---|
| Supported | Next.js, Hono, Expo Router, SvelteKit, TanStack Start, React Router |
| Community | Astro, Edge Functions, Elysia, H3, Nuxt, NestJS, Node, SolidStart |
| APIs and agents | oRPC, MCP servers, WebMCP, any other framework |
| In the browser | The client, React, React Native, Vue, Solid, Svelte |
| On the device | PowerSync, SQLite, TanStack DB and live queries |
Supported adapters get the full test matrix, an example app and every guide. Community adapters get a smoke test and a docs page, and fixes may lag. Frameworks explains the tiers.
One command per job. bsb is the short name.
pnpm better-supabase init # config, client and framework glue
pnpm better-supabase gen # types and data hooks
pnpm better-supabase gen --check # exit 1 in CI when the schema drifted
pnpm better-supabase table invoices enable realtime
pnpm better-supabase add queue # a block's SQL into supabase/schemas
pnpm better-supabase add --preset crm # every block a product needs
pnpm better-supabase doctor # RLS, grants, indexes and Supabase advisors
pnpm better-supabase mcp # the CLI as an MCP server for your coding agent
The CLI reference lists every command and flag.
A block is a feature most apps build by hand, such as organizations and invitations, comments, a job queue, a pipeline or invoices. better-supabase add renders its tables, policies and functions into files in your repository, which you review, commit and change like the rest of your schema. When the block has a TypeScript side, the app calls it on db.
pnpm better-supabase add comments --over public.invoices
pnpm better-supabase add --preset crm
pnpm better-supabase doctor
The block catalog covers organizations and identity, the database, collaboration, work, CRM, commerce, content, AI, automation, developer tools, growth, and people and scheduling. A preset installs the blocks for a whole product, such as a CRM, a helpdesk or a CMS, and blocks can run over your own tables.
Each integration is an optional peer, loaded only from its own subpath.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.