# better-supabase

> A strongly typed layer over Supabase for apps, APIs, MCP servers and jobs.

better-supabase is a TypeScript library for Supabase: typed repositories
compiled to PostgREST, auth for every caller, framework adapters, blocks
(SQL modules with typed APIs) and a CLI for codegen and doctor checks.

Every page below is Markdown. Add `.md` to a page URL, or send
`Accept: text/markdown`, to read any other page the same way.

## Docs

- [Introduction](https://bettersupabase.com/docs.md): A strongly typed layer over Supabase for apps, APIs, MCP servers and jobs.
- Get started
  - [Get started](https://bettersupabase.com/docs/get-started.md): Install better-supabase, see an example and follow a tutorial.
  - Getting started
    - [Quickstart](https://bettersupabase.com/docs/getting-started.md): Install better-supabase, generate your schema and run your first typed query.
    - [Peers](https://bettersupabase.com/docs/getting-started/peers.md): The optional peer dependencies of better-supabase, the version ranges they accept and the subpaths that need each one.
  - [Examples](https://bettersupabase.com/docs/examples.md): Runnable apps for every integration, built against a local stack.
  - Build
    - [Build a ChatGPT clone](https://bettersupabase.com/docs/build/chatgpt-clone.md): The modules, routes and components behind the example's /assistant and /knowledge pages, from a stored chat to tenant keys and metering.
    - [Build a workflow builder](https://bettersupabase.com/docs/build/workflow-builder.md): The modules, routes and components behind the example's /workflows pages, where members draw a graph, publish it and watch each run on the canvas.
    - [Build a unibox inbox](https://bettersupabase.com/docs/build/unibox-inbox.md): The modules, routes and components behind the example's /inbox page and Help sheet, where the assistant answers first and staff take over, plus the channel adapters that bring Slack and WhatsApp into the same list.
- Concepts
  - [Schema and codegen](https://bettersupabase.com/docs/concepts.md): What better-supabase generates on top of supabase gen types, and why.
  - [Casing](https://bettersupabase.com/docs/concepts/casing.md): snake_case or camelCase models, mapped at the edge of the database.
  - [Results and errors](https://bettersupabase.com/docs/concepts/results.md): Every call returns a Result with a typed, serializable DbError.
  - [better-result](https://bettersupabase.com/docs/concepts/better-result.md): Return better-result values from repositories with withBetterResult, or convert single results at the boundary.
  - [Caching](https://bettersupabase.com/docs/concepts/caching.md): How reads know which tables they touched, and how writes invalidate exactly those reads.
  - [Temporal](https://bettersupabase.com/docs/concepts/temporal.md): Instants, durations and the clock as Temporal values, and the polyfill for runtimes without it.
  - [Naming](https://bettersupabase.com/docs/concepts/naming.md): The names better-supabase uses for definitions, instances, files and types, and the renames from earlier versions.
  - [Commerce](https://bettersupabase.com/docs/concepts/commerce.md): Money in bigint minor units, and versioned payment and tax providers with Stripe adapters.
  - [Nested tenancy](https://bettersupabase.com/docs/concepts/nested-tenancy.md): Model an organization with environments, projects or workspaces under it, and decide which level the modules treat as the tenant.
- Data
  - [Data](https://bettersupabase.com/docs/data.md): Read and write rows, records and the platform primitives under them.
  - Repository
    - [Repository](https://bettersupabase.com/docs/repository.md): A typed repository per table, compiled to one PostgREST request.
    - [App tables](https://bettersupabase.com/docs/repository/tables.md): Declare the tables your app owns in tables, and better-supabase upgrade writes them with the scope column, row level security, grants and a pgTAP test.
    - [Subjects](https://bettersupabase.com/docs/repository/record-types.md): Titles and links for any record in config.records, resolved in one batched call, with the SubjectLink and SubjectChip recipes.
    - [Record bindings](https://bettersupabase.com/docs/repository/record-bindings.md): Load the comments, files and tags of one record page in parallel, each settled, hidden when the caller can't read it, and kept current over one realtime subscription.
    - [Record lists and My work](https://bettersupabase.com/docs/repository/record-lists.md): Show record binding columns on a list page, keep its state in the URL, merge a record's bindings into one timeline, and list what waits on the caller across blocks.
    - [Access contract](https://bettersupabase.com/docs/repository/permissions.md): One permission check for RLS policies and SQL modules, over a role list, your own role tables, an authorization provider or functions you already have.
    - [Filtering](https://bettersupabase.com/docs/repository/filtering.md): Column operators, AND/OR/NOT, and filters through relations.
    - [Includes](https://bettersupabase.com/docs/repository/includes.md): Load related rows in the same request, typed by relation cardinality.
    - [Aggregates](https://bettersupabase.com/docs/repository/aggregates.md): Sums, averages, minimums, maximums and grouped counts in one request, without loading rows.
    - [Read sets and $many](https://bettersupabase.com/docs/repository/read-sets.md): Run several reads as one round trip, a single GET to a stable function or one SQL transaction.
    - [Pagination](https://bettersupabase.com/docs/repository/pagination.md): Page numbers or offset windows with totals, or keyset cursors for infinite lists.
    - [Writing](https://bettersupabase.com/docs/repository/writing.md): create, update, upsert and delete, with typed conflicts and optimistic concurrency.
    - [Unique keys and errors](https://bettersupabase.com/docs/repository/unique-and-errors.md): get by any unique key, typed constraint names, and narrowing database errors.
    - [validation](https://bettersupabase.com/docs/repository/validation.md): Validate writes with zod, valibot or any Standard Schema.
    - [Query guards](https://bettersupabase.com/docs/repository/guards.md): Runtime checks that catch unbounded reads, missing organizations, sensitive columns and admin keys in the browser.
    - [Lint rules](https://bettersupabase.com/docs/repository/lint.md): Catch unbounded reads and unscoped deletes in the editor, with ESLint or oxlint.
  - Platform
    - [List queries](https://bettersupabase.com/docs/platform/list.md): Search, facets, sorting and pagination from one definition, safe from the URL to SQL.
    - [Storage](https://bettersupabase.com/docs/platform/storage.md): Typed bucket paths, generated policies, and the upload flows apps keep rewriting.
    - [Realtime](https://bettersupabase.com/docs/platform/realtime.md): Typed broadcast topics with generated authorization, row-change triggers and disposable subscriptions.
    - [Edge Functions](https://bettersupabase.com/docs/platform/edge-functions.md): Typed Edge Function calls, with Standard Schema input and output and a Result on the client.
    - [Supabase Lite](https://bettersupabase.com/docs/platform/lite.md): Run better-supabase on Supabase Lite, generate types from a Lite project and test against it in memory.
  - [Content mapper](https://bettersupabase.com/docs/content-mapper.md): Serve the schema types to TypeScript 7.1 from the snapshot, without writing database.types.ts.
- Auth and server
  - [Overview](https://bettersupabase.com/docs/auth.md): One resolver for every caller, local verification, and refreshes only where they belong.
  - [Environment](https://bettersupabase.com/docs/auth/env.md): Validated Supabase settings, with every framework spelling and no leaked values.
  - [Session cookies](https://bettersupabase.com/docs/auth/sessions.md): Read and write the @supabase/ssr cookie format from any framework.
  - [MFA and SSO](https://bettersupabase.com/docs/auth/mfa-sso.md): Require a second factor on routes, actions, pages and RLS policies, and scope SSO users to their tenant.
  - [OAuth consent and connected agents](https://bettersupabase.com/docs/auth/oauth-consent.md): Serve the consent page for the Supabase Auth OAuth server from your app, and let users see and disconnect the agents they approved.
  - [External access tokens](https://bettersupabase.com/docs/auth/access-tokens.md): Accept RFC 9068 JWT access tokens from your own or a platform's authorization server, verified against its JWKS, so the request runs as the user under RLS.
  - [Account deletion](https://bettersupabase.com/docs/auth/account-deletion.md): Delete or suspend a user, end their sessions, remove their Storage objects, and keep foreign keys from blocking a delete.
  - [Impersonation](https://bettersupabase.com/docs/auth/impersonation.md): Let support staff view the app as a user, read-only by default, with every session recorded and audited.
  - [createServer](https://bettersupabase.com/docs/auth/server.md): Repositories bound to the caller, plus explicit admin and acting-as identities.
  - [Middleware and proxy](https://bettersupabase.com/docs/auth/middleware.md): withBetterSupabase as an @supabase/middleware entry, framework bridges, and composing the Next.js proxy with i18n, rewrites and Server-Timing.
  - [Direct Postgres](https://bettersupabase.com/docs/auth/postgres.md): The same repositories over SQL, with the same results and RLS.
  - [Problem Details](https://bettersupabase.com/docs/auth/problems.md): DbError as RFC 9457 application/problem+json, with RFC 6750 challenges.
- Frameworks
  - [Overview](https://bettersupabase.com/docs/frameworks.md): One adapter per framework runs withBetterSupabase in its middleware, so every route, loader and action gets the caller's repositories.
  - [Next.js](https://bettersupabase.com/docs/frameworks/next.md): Proxy, Server Components, route handlers, server actions and cache tags.
  - [Cache Components](https://bettersupabase.com/docs/frameworks/next-cache-components.md): Instant navigations, prefetching and role-aware UI with Next.js 16.3 Cache Components.
  - [Island pattern](https://bettersupabase.com/docs/frameworks/next-islands.md): Many private Suspense islands on one page that share one token verification per request.
  - [Hono](https://bettersupabase.com/docs/frameworks/hono.md): Middleware, Result-aware handlers and REST resources matching your OpenAPI document.
  - [Hono and Next.js together](https://bettersupabase.com/docs/frameworks/hono-and-next.md): One server for a Next.js app and a Hono API, with shared cookies, CORS and Problem Details.
  - [Expo Router](https://bettersupabase.com/docs/frameworks/expo.md): Server loaders, API routes and middleware that verify the caller and run as them.
  - [TanStack Start](https://bettersupabase.com/docs/frameworks/tanstack-start.md): Run withBetterSupabase as TanStack Start request middleware, with the caller's repositories in every server function.
  - [SvelteKit](https://bettersupabase.com/docs/frameworks/sveltekit.md): Run withBetterSupabase as a SvelteKit handle hook, with the caller's repositories on event.locals.
  - [React Router](https://bettersupabase.com/docs/frameworks/react-router.md): Run withBetterSupabase as React Router server middleware, with the caller's repositories in loaders and actions.
  - [Astro](https://bettersupabase.com/docs/frameworks/astro.md): Run better-supabase as Astro middleware, guard pages, write Actions that return ActionResults, and render Storage images.
  - [Edge Functions](https://bettersupabase.com/docs/frameworks/edge.md): Fetch handlers for Supabase Edge Functions, Deno, Bun and Workers.
  - [Elysia](https://bettersupabase.com/docs/frameworks/elysia.md): Run withBetterSupabase around an Elysia app, with the caller's repositories derived into every route.
  - [H3 and Nitro 3](https://bettersupabase.com/docs/frameworks/h3.md): Run withBetterSupabase as H3 2 middleware, with the caller's repositories on event.context.
  - [Nuxt and Nitro 2](https://bettersupabase.com/docs/frameworks/nuxt.md): Register withBetterSupabase as Nitro 2 server middleware with the Nuxt module or toH3V1, and guard server routes.
  - [NestJS](https://bettersupabase.com/docs/frameworks/nestjs.md): Run withBetterSupabase as NestJS middleware, read the caller with @Ctx(), and guard routes by role.
  - [Node, Express, Fastify and Koa](https://bettersupabase.com/docs/frameworks/node.md): Run withBetterSupabase on node:http, Express, Fastify or Koa, with route guards and Problem Details errors.
  - [SolidStart](https://bettersupabase.com/docs/frameworks/solid-start.md): Run better-supabase as SolidStart middleware and read the caller in queries, actions and API routes.
  - [oRPC](https://bettersupabase.com/docs/frameworks/orpc.md): A middleware that adds the caller's repositories to the oRPC context.
  - [MCP servers](https://bettersupabase.com/docs/frameworks/mcp.md): Tools from your tables and your own code, running as the signed-in user.
  - [Other frameworks](https://bettersupabase.com/docs/frameworks/other.md): Run withBetterSupabase in any framework through a bridge, or write an adapter with handle().
- Frontend
  - [Browser client](https://bettersupabase.com/docs/frontend/client.md): Repositories in the browser that follow the session.
  - [Data hooks](https://bettersupabase.com/docs/frontend/data-hooks.md): Generated list and record hooks per table for React, Vue, Svelte and Solid, with optimistic writes, on a memory cache, TanStack Query, TanStack DB or a database on the device.
  - [Block controllers](https://bettersupabase.com/docs/frontend/block-controllers.md): The framework-agnostic state behind every block hook, and the ports that give it storage, shortcuts, files, push and deep links on the web and React Native.
  - [React](https://bettersupabase.com/docs/frontend/react.md): Provider, typed hooks and the server session.
  - [React Native](https://bettersupabase.com/docs/frontend/react-native.md): Repositories in Expo and React Native apps, with sessions in the device keychain.
  - [Vue](https://bettersupabase.com/docs/frontend/vue.md): A Vue plugin, typed composables, live queries, presence and actions from better-supabase/vue.
  - [Solid](https://bettersupabase.com/docs/frontend/solid.md): A provider and typed primitives for Solid and SolidStart from better-supabase/solid.
  - [Svelte](https://bettersupabase.com/docs/frontend/svelte.md): Svelte 5 bindings for live queries, presence, actions and the session from better-supabase/svelte.
  - Local data
    - [Local data](https://bettersupabase.com/docs/frontend/local-data.md): The same data hooks on TanStack Query, TanStack DB, a device database or a live query.
    - [TanStack Query](https://bettersupabase.com/docs/frontend/query.md): Typed query and mutation options for every table.
    - [TanStack DB](https://bettersupabase.com/docs/frontend/tanstack-db.md): TanStack DB collections that load through a query option and write through the repositories, next to the data hooks.
    - [Live queries](https://bettersupabase.com/docs/frontend/live-queries.md): Keep any query fresh over Realtime, without sending row data over the socket.
    - [PowerSync](https://bettersupabase.com/docs/frontend/powersync.md): The data hooks and the repositories on a PowerSync SQLite database on the device.
    - [SQLite](https://bettersupabase.com/docs/frontend/sqlite.md): The data hooks and the repositories on a local Expo SQLite or Supabase Lite database, without PowerSync.
- APIs
  - [API documents](https://bettersupabase.com/docs/specs.md): Describe your API once with defineApi, then render OpenAPI 3.0, 3.1, 3.2 or the 3.3 preview from the same model and serve it with an ETag.
  - [Resources](https://bettersupabase.com/docs/specs/resources.md): REST resources that serve and document the same routes, with hooks for business logic, custom actions, response overrides and permissions checked by your authorizer.
  - [Customize the model](https://bettersupabase.com/docs/specs/customize.md): Security and error presets, operation and component names, extend, custom routes, fragments, enrich hooks, plugin descriptions and schema comments in defineApi.
  - [OpenAPI versions](https://bettersupabase.com/docs/specs/openapi.md): What OpenAPI 3.0, 3.1, 3.2 and the 3.3 preview render from the same model, and which fields fall back to x- extensions in older versions.
  - [AsyncAPI](https://bettersupabase.com/docs/specs/asyncapi.md): Render an AsyncAPI 3.0 or 3.1 document for Realtime table changes, broadcast topics, CloudEvents, outgoing webhooks and the events actions emit, from the same model as OpenAPI.
  - [Arazzo](https://bettersupabase.com/docs/specs/arazzo.md): Render Arazzo 1.0 or 1.1 workflows over your OpenAPI and AsyncAPI documents with defineWorkflow and the built-in workflows, checked against the operations the API has.
  - [Overlays](https://bettersupabase.com/docs/specs/overlay.md): Apply OpenAPI Overlay 1.0, 1.1 and 1.2 documents to a rendered spec with better-supabase/spec, write overlays in TypeScript, and export your changes as one.
  - [Reference UIs](https://bettersupabase.com/docs/specs/reference-ui.md): Serve an interactive API reference for your OpenAPI document with Scalar, Swagger UI, Redoc, Stoplight Elements or RapiDoc, loaded from pinned jsDelivr versions with SRI or from your own assets.
  - [Data API](https://bettersupabase.com/docs/specs/data-api.md): Document the Supabase Data API (PostgREST) next to your own routes, with database column names, PostgREST filters and the RPCs from your schema.
  - [Diagnostics](https://bettersupabase.com/docs/specs/diagnostics.md): Every code defineApi, the OpenAPI, AsyncAPI and Arazzo renderers and their checks report, with its severity, its cause and how to fix it.
- Integrations
  - [Integrations](https://bettersupabase.com/docs/integrations.md): Adapters for the AI SDK, Chat SDK, eve, the Flags SDK and the Workflow SDK.
  - AI SDK
    - [AI SDK](https://bettersupabase.com/docs/ai-sdk.md): Convert between AI SDK UI messages and the canonical message format, attribute spend in the AI Gateway, and keep the model catalog and costs current.
    - [Assistant](https://bettersupabase.com/docs/ai-sdk/chat.md): A chat route over the AI chat block with createAssistant, and useAssistant on the client, with resumable answers, stop, model checks, moderation and quotas.
    - [Durable chat](https://bettersupabase.com/docs/ai-sdk/workflow.md): Answers that run as Workflow SDK workflows with durableChat and durableTurn, tool approvals that wait for hours, stop through a hook, reconnects by chunk index and progress in ai_run_steps.
    - [Files](https://bettersupabase.com/docs/ai-sdk/files.md): Read supabase-storage file parts in the AI SDK's experimental_download, store generated files and cache provider file references.
    - [Embeddings](https://bettersupabase.com/docs/ai-sdk/embeddings.md): Embed knowledge with an AI SDK model or Supabase's built-in model, rerank hits, and give the model a search tool that cites its sources.
    - [Memory](https://bettersupabase.com/docs/ai-sdk/memory.md): Give the model the memory tool, Anthropic's built-in memory tool, a recall tool and its core memory, and extract facts from a conversation in a job.
    - [Agents](https://bettersupabase.com/docs/ai-sdk/agents.md): Build a ToolLoopAgent from a stored agent with its tools, approvals and knowledge search, and check input and output with a moderation middleware.
    - [MCP connectors](https://bettersupabase.com/docs/ai-sdk/mcp.md): Authorize a user with an MCP server through OAuth with dynamic client registration in Vault, connect with the stored session and give the model the server's tools.
    - [Tenant keys and sandboxes](https://bettersupabase.com/docs/ai-sdk/providers.md): Send each tenant's own provider keys to the AI Gateway as BYOK, and keep the sandbox registry current while a sandbox runs.
    - [Metering](https://bettersupabase.com/docs/ai-sdk/telemetry.md): Meter every model call on the tenant's usage meters through registerTelemetry, and reconcile each tenant's AI Gateway spend nightly.
    - [Response cache](https://bettersupabase.com/docs/ai-sdk/cache.md): A wrapLanguageModel middleware that answers repeated model calls from the AI cache block and replays cached streams.
    - [Batches](https://bettersupabase.com/docs/ai-sdk/batches.md): Start AI SDK batches for a tenant, poll them from a job, and store each request's result in Postgres.
  - Chat SDK
    - [Chat SDK](https://bettersupabase.com/docs/chat-sdk.md): Run Chat SDK bots on Supabase with a Postgres state adapter, an inbox adapter for the in-app widget, and helpers that record Slack, WhatsApp and SMS messages in the inbox.
    - [State](https://bettersupabase.com/docs/chat-sdk/state.md): createSupabaseState, a Chat SDK StateAdapter on Postgres with subscriptions, locks, a cache, lists and per-thread queues.
    - [Inbox adapter](https://bettersupabase.com/docs/chat-sdk/inbox-adapter.md): inboxAdapter, a Chat SDK adapter whose threads are inbox conversations, so a bot answers visitors in the in-app widget and staff can take over.
    - [Channels](https://bettersupabase.com/docs/chat-sdk/channels.md): Record Slack, WhatsApp, Messenger and SMS conversations in the inbox with Chat SDK adapters, deliver staff replies on their channel and keep the event store clean.
    - [Identities](https://bettersupabase.com/docs/chat-sdk/identities.md): Run bot jobs as the chat author's linked user, decide approval buttons through the authorization provider, and link approval prompts to the app.
  - eve
    - [eve on Supabase](https://bettersupabase.com/docs/eve.md): Run eve agents on Supabase with the Workflow World on Postgres, Supabase sign-in on eve routes, connections over credential providers, memory, sessions in the chat tables and the inbox as a channel.
  - Flags SDK
    - [Flags SDK](https://bettersupabase.com/docs/flags-sdk.md): Declare flags with the Vercel Flags SDK and evaluate them from the flags block, per user, per tenant and per custom context such as a brand, with precompute and Flags Explorer.
  - [Workflow SDK](https://bettersupabase.com/docs/blocks/workflow-sdk.md)
- Production
  - [Production](https://bettersupabase.com/docs/production.md): Run better-supabase in production and test it against the local stack.
  - [Testing](https://bettersupabase.com/docs/testing.md): Test RLS, APIs and SQL against the local stack as real users.
  - Production notes
    - [Monorepos](https://bettersupabase.com/docs/guides/monorepo.md): One runtime package owns defineSupabase and the request context; domain packages type their repositories from its db and never import the generated client.
    - [Supabase library MCP blocks](https://bettersupabase.com/docs/guides/supabase-blocks.md): Add typed repositories to the MCP server and headless app blocks from the Supabase library, or replace their tools with createMcp.
    - [Data API grants](https://bettersupabase.com/docs/guides/data-api-grants.md): Declare which tables the Data API roles reach, for projects that don't grant new tables automatically.
    - [Read replicas](https://bettersupabase.com/docs/guides/read-replicas.md): Send reads to a Supabase read replica and keep read-your-writes after a mutation.
    - [Offline-first](https://bettersupabase.com/docs/guides/offline-first.md): Read and write on the device with the PowerSync engine, and upload the changes through the repositories.
    - [Jobs, webhooks and agents without a session](https://bettersupabase.com/docs/guides/without-a-session.md): Run background jobs, webhook handlers and MCP tools as a specific user, so RLS keeps deciding, and keep the service role for the work no user owns.
    - [CSV downloads](https://bettersupabase.com/docs/guides/csv-downloads.md): Turn rows into RFC 4180 CSV or a download response with toCsv, csvColumns and csvResponse from better-supabase/server.
    - [Limitations](https://bettersupabase.com/docs/guides/limitations.md): What PostgREST can't do, and what better-supabase does instead.
- Upgrading
  - [Overview](https://bettersupabase.com/docs/migration.md): Guides for upgrading between better-supabase versions and for moving an existing app or library onto better-supabase.
  - [Existing apps](https://bettersupabase.com/docs/migration/existing-apps.md): Bring better-supabase into an app that already has its own tables, permissions, events and middleware, one module at a time.
  - [From 0.14 to 0.15](https://bettersupabase.com/docs/migration/0.14-to-0.15.md): What to change when upgrading to better-supabase 0.15, where the config is grouped, the runtime instance is bsb, the SQL engine says block and the CLI has one command per job.
  - [From 0.13 to 0.14](https://bettersupabase.com/docs/migration/0.13-to-0.14.md): What to change when upgrading to better-supabase 0.14, where block methods take a subject ref and read the tenant from the block.
  - Older versions
    - [Older versions](https://bettersupabase.com/docs/migration/older.md): Upgrade guides for versions before 0.13.
    - [From 0.11 to 0.12](https://bettersupabase.com/docs/migration/0.11-to-0.12.md): What to check when upgrading to better-supabase 0.12 and 0.13, starting with the audit() signature, the acting_member() grant and the module file headers.
    - [From 0.9 to 0.10](https://bettersupabase.com/docs/migration/0.9-to-0.10.md): What to check when upgrading from better-supabase 0.9 to 0.10 and 0.11, starting with the webhook format of adopted endpoints, the attachment permission defaults and the regenerated realtime triggers.
    - [From 0.8 to 0.9](https://bettersupabase.com/docs/migration/0.8-to-0.9.md): What to change when upgrading to better-supabase 0.9, which routes permission checks through the authorization provider, caps delegated tokens, runs workflows as their publisher, approves support sessions by a second admin and sends CloudEvents webhooks.
    - [From 0.5 to 0.6](https://bettersupabase.com/docs/migration/0.5-to-0.6.md): What to change when upgrading to better-supabase 0.6, which renames kits to blocks, moves the feature modules under better-supabase/blocks, spells out organization and replaces the PermDock settings with authorization providers.
    - [From 0.4 to 0.5](https://bettersupabase.com/docs/migration/0.4-to-0.5.md): What to change when upgrading to better-supabase 0.5, which renames SQL kit objects to the repo standard and makes the kit fail closed.
    - [From 0.3 to 0.4](https://bettersupabase.com/docs/migration/0.3-to-0.4.md): What to change when upgrading to better-supabase 0.4, which makes requests, generated types and the CLI cheaper.
    - [From 0.1 to 0.2](https://bettersupabase.com/docs/migration/0.1-to-0.2.md): What to change when upgrading to better-supabase 0.2, which renames claims and SQL functions to one claim contract.
  - [From plain supabase-js](https://bettersupabase.com/docs/migration/supabase-js.md): Move an app that calls supabase.from() directly to typed repositories, one query at a time.
  - [From supabase-cache-helpers](https://bettersupabase.com/docs/migration/supabase-cache-helpers.md): Map @supabase-cache-helpers/postgrest-react-query hooks to better-supabase.

## Blocks

- [Overview](https://bettersupabase.com/docs/blocks.md): Blocks for SaaS apps. Each one installs SQL into your schema and, when it has a TypeScript side, a client on db.
- Using blocks
  - [Using blocks](https://bettersupabase.com/docs/blocks/using.md): Install a block, name an instance and call it through the client.
  - [createBlocks](https://bettersupabase.com/docs/blocks/create-blocks.md): Build several blocks from one set of options and the generated block config, and wire them on the ports they provide and consume, from better-supabase/blocks.
  - [Typed blocks](https://bettersupabase.com/docs/blocks/typed-blocks.md): Rename a block's entities once in the config, and get typed config keys, renamed clients, subjects, name constants and input schemas from better-supabase gen.
  - [Block SQL](https://bettersupabase.com/docs/blocks/sql.md): The SQL a block installs into your declarative schema. The files are idempotent, and you commit them with the app.
  - [Your own schemas](https://bettersupabase.com/docs/blocks/own-schemas.md): Keep your own declarative schema files next to the block files. The CLI detects your tables, and each block runs over the ones you already have and creates the rest.
  - [Composing blocks](https://bettersupabase.com/docs/blocks/composing-blocks.md): Where the glue between blocks lives, from record pages and lists to default automations between blocks and forms with custom fields.
  - [Entity forms](https://bettersupabase.com/docs/blocks/entity-forms.md): Build a create or edit form from a block's entity schema and the organization's custom fields, and validate both together.
- Organizations and identity
  - [Organizations and identity](https://bettersupabase.com/docs/blocks/catalog-organizations.md): Organizations, members, roles and the identity blocks an account needs.
  - [Organizations and invitations](https://bettersupabase.com/docs/blocks/organizations.md): Create organizations, manage members and roles, invite by email and switch the active organization, on tables you already have or tables the block creates.
  - [Memberships](https://bettersupabase.com/docs/blocks/memberships.md): Scope every query to the request's organization, on top of RLS.
  - [Profiles](https://bettersupabase.com/docs/blocks/profiles.md): A profile row per user, created on sign-up from auth metadata, with a unique username, an email mirror and columns users can't change.
  - [Audit log](https://bettersupabase.com/docs/blocks/audit.md): Record events, and list, reveal and export a tenant's audit entries as NDJSON, CSV or OCSF, and purge them per tenant's retention.
  - [Settings](https://bettersupabase.com/docs/blocks/settings.md): Per-user and per-organization settings with a Standard Schema per key, defaults, typed get and set, and matching pg_jsonschema checks.
  - [Data lifecycle](https://bettersupabase.com/docs/blocks/data-lifecycle.md): Data exports for a user or an organization as NDJSON files in Storage, and organization deletion with a grace period, a cancel and a purge job.
  - [SSO](https://bettersupabase.com/docs/blocks/sso.md): Verified email domains with auto-join, SAML providers per organization, SSO enforcement in the access token hook, and a SCIM 2.0 endpoint that provisions memberships.
  - [Teams](https://bettersupabase.com/docs/blocks/teams.md): Tenant teams and their members, shared with the inbox.
  - [Metrics](https://bettersupabase.com/docs/blocks/metrics.md): Declare metrics with defineMetric, roll them up into metric_points or read small tables directly, and read series and KPIs with a previous-range comparison.
  - [Created by](https://bettersupabase.com/docs/blocks/created-by.md): Record who created, changed and deleted each row, in Postgres and in the repository.
  - [Access requests](https://bettersupabase.com/docs/blocks/access-requests.md): Members ask for a role in their organization, for a set time if they like. The request goes through approvals, the final approval grants the role, and the grant ends early or when it expires.
  - [Identities](https://bettersupabase.com/docs/blocks/identities.md): Link an email address or a chat user to an app user or a contact, through a one-time code the signed-in user issues or a confirmed address.
  - [Custom domains](https://bettersupabase.com/docs/blocks/domains.md): Hostnames an organization serves your app on, its own domains verified by a DNS TXT record and subdomains of your platform domain, with a lookup the proxy runs on every request.
  - [Controls](https://bettersupabase.com/docs/blocks/compliance.md): Compliance frameworks and controls with evidence files and notes, recurring evidence tasks with assignees and an overdue state, versioned policies that members acknowledge, and a status rollup per framework.
- Database
  - [Database](https://bettersupabase.com/docs/blocks/catalog-database.md): Tables, relations, search and the other primitives blocks share.
  - [Number sequences](https://bettersupabase.com/docs/blocks/numbering.md): Gapless document numbers per tenant, entity and period, assigned inside the document's own transaction.
  - [Rank](https://bettersupabase.com/docs/blocks/rank.md): Fractional rank keys for ordered lists and boards, a move() that can change a row's group, and a rebalance job.
  - [Updated at](https://bettersupabase.com/docs/blocks/updated-at.md): createdAt and updatedAt set by a trigger in Postgres and by the repository, without remembering them.
  - [Field history](https://bettersupabase.com/docs/blocks/field-history.md): Record who changed which column of a record, from what to what, with a Postgres trigger on the columns you name.
  - [Field encryption](https://bettersupabase.com/docs/blocks/field-encryption.md): Per-tenant data keys in Supabase Vault that encrypt app table columns and custom fields at rest, with decryption only through definer functions that check scope and can audit each read.
- Collaboration
  - [Collaboration](https://bettersupabase.com/docs/blocks/catalog-collaboration.md): Comments, files, messages and the other blocks people use together.
  - [Notifications](https://bettersupabase.com/docs/blocks/notifications.md): In-app notifications with per-recipient state, subject subscriptions, channel preferences, email and push deliveries, and realtime updates on a private topic.
  - [Push notifications](https://bettersupabase.com/docs/blocks/push.md): Push tokens per device with RLS, Expo device registration, and a sender for the Expo Push API that prunes dead tokens.
  - [Inbox](https://bettersupabase.com/docs/blocks/inbox.md): A shared inbox for support conversations from an in-app widget, Slack, WhatsApp, SMS and other channels, with assignment, internal notes, read receipts, bot handoff and realtime updates.
  - [Comments](https://bettersupabase.com/docs/blocks/comments.md): Comments on any record as its conversation on the messaging core, with replies, mentions, resolved threads, pins, edit history, anchors, files and comments turned into tasks.
  - [Activity](https://bettersupabase.com/docs/blocks/timeline.md): An activity feed per tenant and a timeline per record, filled from outbox events and joined with audit entries, notification deliveries and workflow runs.
  - [Messaging](https://bettersupabase.com/docs/blocks/messaging.md): The conversations, members, messages, threads and read markers that channels, direct messages and record threads share.
  - [Channels](https://bettersupabase.com/docs/blocks/channels.md): Public and private team channels on the messaging core, with topics, membership, linked records and live hooks for a chat screen.
  - [Attachments](https://bettersupabase.com/docs/blocks/attachments.md): Files linked to records in a tenant, uploaded through signed URLs to a private bucket and served only after a malware scan.
  - [Share links](https://bettersupabase.com/docs/blocks/share-links.md): Hashed share links, view counts and per-user state. The token is returned once.
  - [Reactions](https://bettersupabase.com/docs/blocks/reactions.md): Emoji reactions and up or down votes on any subject, messages (comments included) and inbox messages, with custom emoji per organization, counts under each subject's read rules and a realtime topic per organization.
  - [Posts](https://bettersupabase.com/docs/blocks/posts.md): Forum and feedback boards with voted posts, roadmap statuses, merged duplicates, replies and moderation, on the messaging core.
  - [Moderation](https://bettersupabase.com/docs/blocks/moderation.md): Reports on any record, a review queue, decisions (approve, hide, remove, restore, ban) with a log, user bans and an automatic hide threshold. Reviews and messages, comments included, moderate through it.
  - [Enrollments](https://bettersupabase.com/docs/blocks/enrollments.md): Programs of steps per organization, and enrollments of a party, a member or any record in them with step progress and completion. Onboarding checklists run on it.
  - [Guests](https://bettersupabase.com/docs/blocks/guests.md): Invite clients and contractors by email to read, comment on and upload to the records you grant them, and let a customer see the invoices and bookings of the party they act for. Guests are never members, and no authorization library is involved.
- Work
  - [Work](https://bettersupabase.com/docs/blocks/catalog-work.md): Tasks, goals and the blocks that track work on a record.
  - [Tags](https://bettersupabase.com/docs/blocks/tags.md): Tag definitions per kind, applied to subjects through one table or a link table per subject.
  - [State machine](https://bettersupabase.com/docs/blocks/state-machine.md): Allowed status transitions as the caller, a history row, status events, and an optional lifecycle with pause, flags and a pinned version.
  - [Custom fields](https://bettersupabase.com/docs/blocks/custom-fields.md): Field definitions, options and typed values, with a permission check for sensitive values.
  - [Saved views](https://bettersupabase.com/docs/blocks/saved-views.md): Named list views per user, team or organization, with the filter tree, sort, columns, grouping and density checked against the list definition, personal defaults, duplicates, and useSavedViews for nuqs.
  - [Relations](https://bettersupabase.com/docs/blocks/relations.md): Typed links between subjects (blocks, parent, relates or your own kinds) with inverse names, cycle checks, one-target kinds, ancestors, descendants, rollups and undo tokens.
  - [Bulk actions](https://bettersupabase.com/docs/blocks/bulk.md): Run one action over many rows with a result per row, in one call up to a limit and as a background run on the jobs queue beyond it, as the user who started it.
  - [Undo](https://bettersupabase.com/docs/blocks/undo.md): Apply the undo tokens that block methods return, on the server with createUndo and in the browser with a useUndoStack for a toast's Undo button.
  - [Search](https://bettersupabase.com/docs/blocks/search.md): A search index kept up by triggers from config.records, search(q) as the caller, recents and favorites, and useCommandSearch for a Cmd+K dialog.
  - [Approvals](https://bettersupabase.com/docs/blocks/approvals.md): Approval requests with steps per subject type and action, approvers by permission, role, team or user, delegation, expiry and reminders. The final approval runs a state-machine transition or a job.
  - [Assets and locations](https://bettersupabase.com/docs/blocks/assets.md): A location hierarchy (site, building, unit) and an asset registry with tags, status, coordinates and assignment to members or records. Optional PostGIS stores points and areas as geography; booking resources and work items can name an asset.
  - [Pipelines](https://bettersupabase.com/docs/blocks/pipelines.md): Tenant-editable pipelines for any record type, with ordered stages whose categories map to open, success or failure, a stage history with time in stage, board totals per currency, and a status the stage sets through the state machine.
  - [Collections](https://bettersupabase.com/docs/blocks/collections.md): Favorites (a member's starred records, ranked for a sidebar), saved items (a member's records to come back to, with a note and a reminder) and lists (named, static collections of one record type owned by a user, a team or the organization) on any registered record.
  - [Work items](https://bettersupabase.com/docs/blocks/tasks.md): Issues and tasks on pipelines, with identifiers, parents without cycles, several assignees, priority 0 to 4, estimates, start, end and due dates, locking, projects, iterations, batched edits and a progress tree.
  - [Service levels](https://bettersupabase.com/docs/blocks/sla.md): First response, next response and resolution clocks on any record, from a policy per record type and priority, in business hours, paused while the record waits, with warnings and breaches a job records.
  - [Dispatch](https://bettersupabase.com/docs/blocks/dispatch.md): Schedule field service work orders into technicians' slots on a board, move them from scheduled to done, plan each technician's day as a route, and record the parts each job used.
- CRM
  - [CRM](https://bettersupabase.com/docs/blocks/catalog-crm.md): Contacts, deals, activities and the blocks around them.
  - [Parties](https://bettersupabase.com/docs/blocks/contacts.md): Companies and people an organization works with, with lifecycle stages, owners, who works where with a role and a primary contact, dedupe by domain and email, merges and keyset-paged search.
  - [Engagements](https://bettersupabase.com/docs/blocks/activities.md): Calls, emails, meetings, notes and tasks logged on one or more records, with an owner, a due time and an outcome, a record's timeline, its next step and a member's open tasks.
  - [Mail sync](https://bettersupabase.com/docs/blocks/mail-sync.md): Sync each member's Gmail or Outlook mailbox through their own OAuth grant, match threads to people and companies, log them as email engagements and send replies.
  - [Segments](https://bettersupabase.com/docs/blocks/segments.md): Save a filter over companies, people, deals or any registered subject, keep its members in Postgres and react when records enter or leave it.
  - [Assignment](https://bettersupabase.com/docs/blocks/assignment.md): Route new leads, deals or tickets to an owner with round robin or weighted queues, each limited to a territory of matching records.
  - [Enrichment](https://bettersupabase.com/docs/blocks/enrichment.md): Look companies and people up with People Data Labs or your own provider, store each result, and fill the record's empty columns.
  - [Sequences](https://bettersupabase.com/docs/blocks/sequences.md): Multi-step outreach with email, wait and task steps that run per contact from their owner's mailbox until the contact replies.
  - [Forecasts](https://bettersupabase.com/docs/blocks/forecasts.md): Snapshot the deals forecast for a period, keep the deals behind each number, and compare two snapshots deal by deal.
  - [Deals](https://bettersupabase.com/docs/blocks/deals.md): Deals on pipelines with amounts in minor units, a company and contacts, a deal team, line items, forecast calls with attainment, close-date slips, a next step, locking and batched edits that reject per change.
  - [Quotes](https://bettersupabase.com/docs/blocks/quotes.md): Quotes with line items and totals, a revision chain, a public link the customer accepts, rejects or asks changes through, expiry, and quotes made from deals.
  - [Targets](https://bettersupabase.com/docs/blocks/goals.md): Goals per period for a member, a team or the organization, with progress the database computes for won deals, completed work items and paid invoices, or a value the app keeps.
  - [Contracts](https://bettersupabase.com/docs/blocks/contracts.md): Contracts with counterparties from draft through review and signature to active, expired or terminated, with values in minor units, renewal terms that schedule reminders, and obligations with due dates and owners.
- Commerce
  - [Commerce](https://bettersupabase.com/docs/blocks/catalog-commerce.md): Catalog, orders, invoices and the blocks that charge money.
  - [Usage and quotas](https://bettersupabase.com/docs/blocks/usage.md): Count usage per tenant and meter with idempotent increments, enforce quotas per tenant or plan in RLS and RPCs, and report usage to Stripe meters.
  - [Billing](https://bettersupabase.com/docs/blocks/billing.md): Stripe customers per tenant, Checkout and the customer portal, seat sync from membership events, and Stripe webhook handling that links customers and refreshes sessions.
  - [Entitlements](https://bettersupabase.com/docs/blocks/entitlements.md): Stripe entitlements per tenant in the access token, in RLS, and fresh again after a plan change.
  - [Catalog](https://bettersupabase.com/docs/blocks/catalog.md): Products, options and variants, prices in bigint minor units per currency and price list, categories, collections, sales channels, translations, product media and a public storefront switch.
  - [Inventory](https://bettersupabase.com/docs/blocks/inventory.md): Stock per catalog variant and location on the ledger block, reservations that expire, transfers between locations and purchase orders with partial receiving.
  - [Ledger](https://bettersupabase.com/docs/blocks/ledger.md): Double-entry accounts in a currency or a custom unit, balanced transactions, running balances and holds. Inventory stock, leave balances and invoice payments post through it, and credits, loyalty points, gift cards and trust balances are account kinds.
  - [Orders](https://bettersupabase.com/docs/blocks/orders.md): Carts for anonymous and signed-in shoppers, a checkout that prices from the catalog, quotes tax, reserves stock and takes the payment once, then fulfillments, returns, refunds and invoices.
  - [Promotions](https://bettersupabase.com/docs/blocks/promotions.md): Percentage, fixed and free-shipping promotions that apply automatically or by code, with usage limits, stacking rules and priorities, priced into orders carts and redeemed at checkout.
  - [Invoices](https://bettersupabase.com/docs/blocks/invoices.md): Invoices an organization sends its own customers, with drafts and lines, a gapless number on issue, payments and refunds, credit notes, void and write-off, overdue and aging per currency, and invoices from accepted quotes.
  - [Reviews](https://bettersupabase.com/docs/blocks/reviews.md): Ratings and reviews of catalog products and other records, one per user and subject, verified against paid orders, moderated before or after publishing, with an aggregate a public storefront can read.
  - [Billable time](https://bettersupabase.com/docs/blocks/billable-time.md): Price tracked time with an hourly rate card per organization, member and record, preview what it would bill, and turn it into draft invoice lines in bigint minor units.
  - [Shipments](https://bettersupabase.com/docs/blocks/shipments.md): Ship packages between addresses, buy labels through a versioned carrier interface, and keep a tracking timeline that a signed carrier webhook updates without duplicates.
  - [Leases](https://bettersupabase.com/docs/blocks/leases.md): Let units to parties with rent in bigint minor units, post each rent period on the ledger once, and hold deposits through ledger holds.
  - [Expenses](https://bettersupabase.com/docs/blocks/expenses.md): Collect expense reports with lines, categories and receipts, check spend policies on submit, approve through the approvals block, and post the approved total and its reimbursement on the ledger.
  - [Donations](https://bettersupabase.com/docs/blocks/donations.md): Record one-off and recurring gifts from donors, post them on the ledger per fund or campaign, charge pledges through a payments provider once per period, and issue numbered tax receipts with a yearly summary.
- Content
  - [Content](https://bettersupabase.com/docs/blocks/catalog-content.md): Documents, posts, forms and the blocks that hold content.
  - [Imports](https://bettersupabase.com/docs/blocks/imports.md): CSV imports with a suggested mapping, a dry run, and `runImport`, which writes the rows in batches and marks the import failed when a batch throws.
  - [Versions](https://bettersupabase.com/docs/blocks/versions.md): Numbered snapshots of a subject's content, with JSON Patch diffs, restore, debounced auto snapshots, frozen versions and retention.
  - [Trash](https://bettersupabase.com/docs/blocks/trash.md): Soft delete through each subject's deletedAt column, with children trashed in one batch, restore with unique checks, a list per organization and purge after a retention period.
  - [Documents](https://bettersupabase.com/docs/blocks/documents.md): Collaborative Yjs documents attached to any subject. The database keeps an update log and a compacted snapshot, a private Realtime topic carries live edits and presence, and better-supabase/yjs connects a Y.Doc to both.
  - [Drive](https://bettersupabase.com/docs/blocks/drive.md): Folders and files on the attachments module. Access is granted to users or teams and inherited down the tree, storage policies enforce it on the objects too, and versions, trash and share-links add revisions, a bin, stars, recent items and folder links.
  - [Forms](https://bettersupabase.com/docs/blocks/forms.md): Versioned forms with steps and show or skip logic, a JSON Schema 2020-12 per version that Postgres checks on every submission, drafts, public links with a rate limit and a bot-check hook, and handlers that turn a submission into a record.
  - [Signatures](https://bettersupabase.com/docs/blocks/signatures.md): Simple electronic signatures on a frozen version of a record, with sequential or parallel signers, a SHA-256 hash per signature and a check that the signed content is unchanged.
  - [Templates](https://bettersupabase.com/docs/blocks/templates.md): Versioned templates that create records, such as an invoice or a project with its tasks, system starters each organization forks, merge fields for text and email, and the workflows each new record starts.
  - [Content](https://bettersupabase.com/docs/blocks/content.md): Pages, posts and other typed entries per organization, with locales, scheduled and approved publishing, versions and a public read by slug.
  - [Courses](https://bettersupabase.com/docs/blocks/courses.md): Courses of modules and lessons in rank order, quiz lessons graded by forms, per-lesson progress, completion and certificates, with learners enrolled through enrollments.
- AI
  - [AI](https://bettersupabase.com/docs/blocks/catalog-ai.md): Chat, knowledge, agents and the blocks an assistant needs.
  - [Vector search](https://bettersupabase.com/docs/blocks/vector-search.md): Nearest-neighbour search with pgvector that respects RLS and still returns k rows per tenant.
  - [AI chat](https://bettersupabase.com/docs/blocks/ai-chat.md): Chats, projects and a branching message tree in a canonical message format, with runs, tool approvals, share links, a model catalog per plan and moderation events.
  - [AI files](https://bettersupabase.com/docs/blocks/ai-files.md): Attachments and generated files for AI chats in a private bucket, provider file references with expiry, and versioned documents with suggested edits.
  - [Knowledge](https://bettersupabase.com/docs/blocks/knowledge.md): Documents chunked and embedded per organization, agent, project, chat or user, with hybrid search that ranks full text and vector matches together.
  - [Memory](https://bettersupabase.com/docs/blocks/memory.md): Core memory files the model edits with Anthropic's memory tool commands, archival facts found by similarity, and recall over a user's earlier messages.
  - [Agents](https://bettersupabase.com/docs/blocks/agents.md): Saved assistants with their own instructions, model, tools, connectors and knowledge, shared in an organization or a public store with installs and ratings.
  - [AI tasks](https://bettersupabase.com/docs/blocks/ai-schedules.md): Prompts a user schedules on a cron in their time zone, a scheduler that queues each run, and a run log with the chat each run wrote to.
  - [AI cache](https://bettersupabase.com/docs/blocks/ai-cache.md): Model responses cached by a hash of the request, with a TTL, a size cap, per-tenant clearing and an hourly purge job.
  - [AI providers](https://bettersupabase.com/docs/blocks/ai-keys.md): Each tenant's own provider keys as credential references, and a registry of provider batch jobs with a poll schedule.
- Automation
  - [Automation](https://bettersupabase.com/docs/blocks/catalog-automation.md): Automations, workflows and the blocks that run them.
  - [Jobs, idempotency and webhook inbox](https://bettersupabase.com/docs/blocks/queue.md): Background jobs on Supabase Queues, safe retries and exactly-once webhook handling on the Postgres you already have.
  - [Outbox](https://bettersupabase.com/docs/blocks/outbox.md): Events written in the same transaction as the change, read by named consumers with their own cursor and relayed as CloudEvents.
  - [Workflows](https://bettersupabase.com/docs/blocks/workflows.md): A run registry for any workflow engine that members read through RLS, cron schedules, counting semaphores, admission control for starts, and useWorkflowRuns over Realtime.
  - [Workflow SDK](https://bettersupabase.com/docs/blocks/workflow-sdk.md): Run the Workflow SDK on Supabase with a World over Postgres and Supabase Queues, and start runs, resume hooks and protect routes as the signed-in user.
  - [Workflow builder](https://bettersupabase.com/docs/blocks/workflow-editor.md): Graph workflows that members edit and publish per tenant, with webhook, schedule and event triggers, credentials by reference, node-level run status and alerts on failed or slow runs.
  - [Durable streams](https://bettersupabase.com/docs/blocks/streams.md): Resumable output for chats, workflows and agents, stored in Postgres or Redis, with a cancel flag the writer reads on its next write.
  - [Connectors](https://bettersupabase.com/docs/blocks/connectors.md): MCP servers an organization connects, each user's OAuth grant behind a credential reference, MCP sessions per chat and tool list fingerprints an admin approves.
  - [Rules](https://bettersupabase.com/docs/blocks/automations.md): Tenant-editable rules that test a subject against a filter tree when a trigger event happens and name the actions your app runs, evaluated the same way in SQL and TypeScript.
- Developer
  - [Developer](https://bettersupabase.com/docs/blocks/catalog-developer.md): API keys, webhooks, flags and the blocks a platform exposes.
  - [Outgoing webhooks](https://bettersupabase.com/docs/blocks/webhooks-out.md): Signed webhooks to your customers' endpoints, with event subscriptions, retries, a queryable delivery log, secret rotation, URL checks and auto-disable.
  - [Incoming webhooks](https://bettersupabase.com/docs/blocks/webhooks-in.md): Trigger URLs a tenant hands to other systems, with hashed tokens, optional signatures, limits and an inbox.
  - [API keys](https://bettersupabase.com/docs/blocks/api-keys.md): Hashed API keys for tenants and users, with scopes, expiry, rotation, a rate limit per key and an apiKey caller in every server adapter.
  - [Service principals](https://bettersupabase.com/docs/blocks/service-accounts.md): Non-human organization members that can't sign in, hold a role through a membership, and run organization-owned workflows and service webhook endpoints.
  - [Signing keys](https://bettersupabase.com/docs/blocks/signing-keys.md): Asymmetric keys per owner in Supabase Vault, with rotation that keeps old keys published until their tokens expire, a JWKS endpoint and a signer for JWTs and Ed25519 webhooks.
  - [Shared signals](https://bettersupabase.com/docs/blocks/security-events.md): An OpenID Shared Signals transmitter and receiver, with CAEP and RISC events as signed Security Event Tokens, pushed through outgoing webhooks or polled.
  - [OAuth server](https://bettersupabase.com/docs/blocks/oauth-server.md): Storage for your own OAuth 2.1 authorization server, with hashed client secrets, PKCE-bound authorization codes, device codes, grants and a revocation list.
  - [Vercel Marketplace](https://bettersupabase.com/docs/blocks/vercel-marketplace.md): Provider state for an integration listed on the Vercel Marketplace, installations, resources, plans, invoices and meter reports, with the Partner API, verified webhooks, the SSO exchange and usage reporting.
  - [Incidents](https://bettersupabase.com/docs/blocks/incidents.md): Incidents with a severity, a status timeline, affected components and postmortems, and a public status page that anyone can read through one function that returns only public fields.
- Growth
  - [Growth](https://bettersupabase.com/docs/blocks/catalog-growth.md): Onboarding, waitlists and the blocks that bring people in.
  - [Feature flags](https://bettersupabase.com/docs/blocks/flags.md): Feature flags per tenant, per user and per custom context such as a brand, with targeting rules, overrides and percentage rollouts, evaluated the same way in RLS, in an OpenFeature provider and in the Flags SDK.
  - [Onboarding](https://bettersupabase.com/docs/blocks/onboarding.md): Onboarding checklists per user or per organization, with steps completed by hand or by an outbox event, and a useOnboarding hook.
  - [Waitlist](https://bettersupabase.com/docs/blocks/waitlist.md): A waitlist with positions and approvals, hashed invite codes with use limits and an optional organization, and a before-user-created hook that makes sign-up invite-only.
  - [Announcements](https://bettersupabase.com/docs/blocks/announcements.md): In-app announcements for everyone, some tenants, some roles or some plans within a time window, with dismissals and a useAnnouncements hook over Realtime.
  - [Lead scoring](https://bettersupabase.com/docs/blocks/lead-scoring.md): Score people and companies under a tenant-editable score model whose rules read the record, its segments, its email activity and its enrichment.
  - [Scores](https://bettersupabase.com/docs/blocks/scores.md): Tenant-editable scoring models that add rule points and weighted metrics into a versioned score with bands on any record. Lead scoring and account health are models.
- People and scheduling
  - [People and scheduling](https://bettersupabase.com/docs/blocks/catalog-people.md): Employees, calendars, bookings and the blocks around them.
  - [Reminders](https://bettersupabase.com/docs/blocks/reminders.md): RFC 5545 recurrence and reminders, expanded in TypeScript and delivered through notifications.
  - [Calendar](https://bettersupabase.com/docs/blocks/calendar.md): Calendars and events with RFC 5545 recurrence, per-occurrence edits, attendees, iCalendar import and export, and an iCal feed through a share link.
  - [Bookings](https://bettersupabase.com/docs/blocks/bookings.md): Bookable resources with weekly hours, services with buffers, open slots computed in SQL, holds that expire, double bookings refused by an exclusion constraint, and public booking through a share link.
  - [Time tracking](https://bettersupabase.com/docs/blocks/time-tracking.md): Timers and logged time on any record, one running timer per member and no overlapping entries enforced by Postgres, weekly timesheets approved through the approvals module, locked weeks, and a weekly grid shape for a data grid.
  - [Hiring](https://bettersupabase.com/docs/blocks/hiring.md): Jobs and applications on a pipeline per job, candidates from config.records, scorecards per stage, interviews, and hire, reject and withdraw events for the app to act on.
  - [Employees](https://bettersupabase.com/docs/blocks/employees.md): Employees with or without an account, a manager, team and status, an org chart, offboarding, and private details and contracts behind employees.view_sensitive.
  - [Leave](https://bettersupabase.com/docs/blocks/leave.md): Leave types in days or hours, requests approved through the approvals module, and balances on the ledger block per member and year with grants, accruals, adjustments and a year-end carryover.
  - [Passes](https://bettersupabase.com/docs/blocks/passes.md): Issue QR and NFC admission passes signed with your signing keys, check holders in at the door, count drop-ins against a resource's capacity with its bookings, and pay for classes with credits.
- Presets
  - [Presets](https://bettersupabase.com/docs/presets.md): Start an app from a named preset or a design from /create, with every block it needs and the conventions it sets.
  - [Designs and the resolver](https://bettersupabase.com/docs/presets/designs.md): How better-supabase/preset reads a preset name or a design, resolves its blocks and writes the config and wiring Create shows.
  - [The Create core](https://bettersupabase.com/docs/presets/create.md): How better-supabase/create holds the design model, previews and Supabase deploy client that /create and other apps share.
  - [CRM](https://bettersupabase.com/docs/presets/crm.md): Deals in pipeline stages, quotes made from deals, sales targets, comments, tags, custom fields and follow-up reminders.
  - [Project management](https://bettersupabase.com/docs/presets/projects.md): Tasks on a status board with a workflow, numbered keys, comments, tags and due-date reminders.
  - [Drive](https://bettersupabase.com/docs/presets/drive.md): Documents in folders with attachments, share links, labels and comments.
  - [Scheduling](https://bettersupabase.com/docs/presets/scheduling.md): Bookings with a request and confirm workflow, custom fields, share links and reminders before the start.
  - [Commerce](https://bettersupabase.com/docs/presets/commerce.md): A store with a catalog imported from CSV, stock, carts on anonymous sign-ins, promotion codes, checkout, invoices and shipping.
  - [CMS](https://bettersupabase.com/docs/presets/cms.md): The cms preset installs pages and posts with locales and scheduled publishing, versions, publish approvals, public media, tags, comments and search.
  - [ERP](https://bettersupabase.com/docs/presets/erp.md): The erp preset installs parties, a catalog, stock by location, quotes priced from the catalog that become orders when accepted, orders that invoice when paid, employees with time and leave, and expenses.
  - [Product information](https://bettersupabase.com/docs/presets/pim.md): The pim preset installs a catalog with sales channels, translations and public product media, plus custom fields, imports, bulk edits, tags, saved views and search.
  - [Property management](https://bettersupabase.com/docs/presets/property.md): The property preset installs units in assets, leases with rent and deposits on the ledger, maintenance requests, tenants with a portal and attachments.
  - [Field service](https://bettersupabase.com/docs/presets/field-service.md): The field-service preset installs a dispatch board of work orders, customer sites in assets, parts from inventory, quotes to invoices, checklists and signatures.
  - [Clinic and therapy](https://bettersupabase.com/docs/presets/clinic.md): The clinic preset installs appointments, intake forms, note templates, consent signatures, field encryption for sensitive values, a client portal and reminders.
  - [Courses and learning](https://bettersupabase.com/docs/presets/lms.md): The lms preset installs courses with modules, lessons and quizzes graded by forms, enrollments with progress, certificates, comments and attachments.
  - [Events and ticketing](https://bettersupabase.com/docs/presets/events.md): The events preset installs tickets in a catalog, orders, capacity through bookings, QR passes signed with signing keys and checked in, a waitlist and reminders.
  - [Legal practice](https://bettersupabase.com/docs/presets/legal.md): The legal preset installs clients and matters, time billed from a rate card into invoices, a trust ledger, documents with versions and signatures.
  - [Expenses and spend](https://bettersupabase.com/docs/presets/spend.md): The spend preset installs expense reports with receipts and spend policies, approvals, the approved total and reimbursement on the ledger, and receipt files for AI extraction.
  - [Contracts](https://bettersupabase.com/docs/presets/contracts.md): The contracts preset installs a contract lifecycle with renewals and obligations, counterparties as parties, signatures on a frozen version and renewal reminders.
  - [Customer success](https://bettersupabase.com/docs/presets/customer-success.md): The customer-success preset installs accounts with health scores, metrics, rules, NPS surveys, playbooks as enrollments and engagements.
  - [Logistics and fleet](https://bettersupabase.com/docs/presets/logistics.md): The logistics preset installs shipments with carrier rates, labels and tracking, orders to ship, customers as parties, and warehouses and vehicles in assets.
  - [Restaurants and POS](https://bettersupabase.com/docs/presets/pos.md): The pos preset installs a menu in the catalog, orders with an optional kitchen display, stock in inventory, table reservations, promotions and the ledger.
  - [Fitness and memberships](https://bettersupabase.com/docs/presets/fitness.md): The fitness preset installs class schedules, bookings with recurring series, membership passes with class credits signed by signing keys, check-in and reminders.
  - [Nonprofit fundraising](https://bettersupabase.com/docs/presets/nonprofit.md): The nonprofit preset installs donors, gifts and pledges posted on the ledger per fund, numbered tax receipts, campaign targets and saved views for donor segments.
  - [IT service management](https://bettersupabase.com/docs/presets/itsm.md): The itsm preset installs tickets with SLAs, change approvals, an asset registry, relations, incidents with a public status page and a knowledge base.
  - [Compliance](https://bettersupabase.com/docs/presets/compliance.md): The compliance preset installs frameworks and controls with recurring evidence tasks, evidence files, versioned policies that members acknowledge and a posture per framework.
  - [Construction](https://bettersupabase.com/docs/presets/construction.md): The construction preset installs punch lists and RFIs as work items, sites in assets, daily logs as forms, drawings with revisions, comments and submittal approvals.
  - [Insurance and claims](https://bettersupabase.com/docs/presets/claims.md): The claims preset installs claimants, a claim state machine, approvals, evidence attachments, SLA clocks and comments.
  - [Community](https://bettersupabase.com/docs/presets/community.md): The community preset installs forum boards of voted posts with replies, chat channels, reactions, moderation with reports and bans, post scores, tags and search.
  - [Product feedback](https://bettersupabase.com/docs/presets/feedback.md): The feedback preset installs feedback boards of voted ideas with roadmap statuses, replies, moderation, links from ideas to the work items that ship them, tags and search.
- UI recipes
  - [Registry](https://bettersupabase.com/docs/registry.md): Install better-supabase glue (block wiring, server actions, hooks, route handlers and Expo config) with the shadcn CLI from the @better-supabase registry.
  - UI recipes
    - [UI recipes](https://bettersupabase.com/docs/registry/ui-recipes.md): Build components and screens for the blocks, such as notifications, search, onboarding, comments, members, API keys, the audit log, billing and settings, from shadcn or React Native components and the blocks' hooks.
    - [Two-factor setup](https://bettersupabase.com/docs/registry/ui-recipes/mfa-setup.md): A card that enrolls an authenticator app with a QR code, verifies the first code and removes the factor.
    - [Can](https://bettersupabase.com/docs/registry/ui-recipes/can.md): Shows an action only to members who hold a permission key; the checks of one render share one round trip.
    - [Subject link](https://bettersupabase.com/docs/registry/ui-recipes/subject-link.md): A link to any subject type, titled and routed by subject_titles, with plain text for a record the caller can't read.
    - [Subject chip](https://bettersupabase.com/docs/registry/ui-recipes/subject-chip.md): A compact badge with a subject's type and title that links to its page.
    - [Sessions list](https://bettersupabase.com/docs/registry/ui-recipes/sessions-list.md): The caller's signed-in devices with the last activity and a button to end each session.
    - [SSO connection settings](https://bettersupabase.com/docs/registry/ui-recipes/sso-settings.md): The organization's SAML or OIDC connection with its domains and the role new members get.
    - [Access requests inbox](https://bettersupabase.com/docs/registry/ui-recipes/access-requests-inbox.md): Requests for access to a resource, with approve and deny buttons for the owner.
    - [My work](https://bettersupabase.com/docs/registry/ui-recipes/my-work.md): What waits on the caller across the installed blocks, from `loadMyWork`: assigned work, approvals, due reminders, mentions and SLA warnings, each linked to its record.
    - [Organization switcher](https://bettersupabase.com/docs/registry/ui-recipes/org-switcher.md): A menu of the user's organizations that switches the active one and refreshes the session for its tenant claim.
    - [Settings layout](https://bettersupabase.com/docs/registry/ui-recipes/settings-layout.md): Settings pages generated from the settings definition: a section per scope and a control per key, picked by the kind its schema declares.
    - [Members table](https://bettersupabase.com/docs/registry/ui-recipes/members-table.md): An organization's members with their roles, where a role change shows at once and a member can be removed.
    - [Invite dialog](https://bettersupabase.com/docs/registry/ui-recipes/invite-dialog.md): A form that invites a teammate by email with a role, then shows the token for the accept link.
    - [Profile form](https://bettersupabase.com/docs/registry/ui-recipes/profile-form.md): A form that updates the caller's display name through a server action and shows field errors.
    - [Workspace URL field](https://bettersupabase.com/docs/registry/ui-recipes/workspace-url-field.md): An organization form with a name and a URL slug, where reserved and taken slugs come back as field errors.
    - [Team picker](https://bettersupabase.com/docs/registry/ui-recipes/team-picker.md): A select of the caller's teams in the active organization, to scope a page or assign work.
    - [Comment thread](https://bettersupabase.com/docs/registry/ui-recipes/comment-thread.md): A record's comments with their authors and a form to add one, kept current after each write.
    - [Channel sidebar](https://bettersupabase.com/docs/registry/ui-recipes/channel-sidebar.md): The caller's channels with unread and mention counts, kept live, with dialogs to browse, join and create channels.
    - [Message list](https://bettersupabase.com/docs/registry/ui-recipes/message-list.md): A conversation's messages over Realtime, with older pages on demand, who is typing, reply counts and the composer.
    - [Message composer](https://bettersupabase.com/docs/registry/ui-recipes/message-composer.md): A message box that sends on Enter, signals typing, and uploads dropped, pasted or picked files onto the message.
    - [Thread panel](https://bettersupabase.com/docs/registry/ui-recipes/thread-panel.md): A thread beside the channel: the root message, its replies live over Realtime, and a composer that replies into it.
    - [Presence avatars](https://bettersupabase.com/docs/registry/ui-recipes/presence-avatars.md): Who else has a record open (a channel, a comment thread's record or a document), on the record's presence topic.
    - [Reactions bar](https://bettersupabase.com/docs/registry/ui-recipes/reactions-bar.md): Emoji reactions under a record with counts, which toggle the caller's own reaction.
    - [Share link dialog](https://bettersupabase.com/docs/registry/ui-recipes/share-link-dialog.md): A dialog that creates an expiring link to a record and revokes it.
    - [Attachments uploader](https://bettersupabase.com/docs/registry/ui-recipes/attachments-uploader.md): A drop zone that uploads files to a record and lists them with a download link.
    - [Subject timeline](https://bettersupabase.com/docs/registry/ui-recipes/subject-timeline.md): One record's comments, files and versions merged newest first, from `bsb.record(...).timeline`, skipping the bindings the caller can't read.
    - [Post board](https://bettersupabase.com/docs/registry/ui-recipes/post-board.md): A feedback board's posts ranked by votes, with an upvote toggle, the roadmap status, moderation state and a New post dialog.
    - [Notification bell](https://bettersupabase.com/docs/registry/ui-recipes/notification-bell.md): A header button with the unread count, which updates when a notification arrives or is read.
    - [Notification list](https://bettersupabase.com/docs/registry/ui-recipes/notification-list.md): The caller's latest notifications with an unread marker, loaded again on every change.
    - [Inbox with threads](https://bettersupabase.com/docs/registry/ui-recipes/inbox-threads.md): A shared inbox of conversations with status tabs, an assignee filter and the open thread beside the list.
    - [Push opt-in](https://bettersupabase.com/docs/registry/ui-recipes/push-opt-in.md): A card that registers this browser for web push and removes it again.
    - [Onboarding checklist](https://bettersupabase.com/docs/registry/ui-recipes/onboarding-checklist.md): The organization's getting-started steps with progress, hidden once every step is done.
    - [Announcement banner](https://bettersupabase.com/docs/registry/ui-recipes/announcement-banner.md): The newest live announcement for the user and organization, with a dismiss button.
    - [Feature flags](https://bettersupabase.com/docs/registry/ui-recipes/feature-flag-toggles.md): Which feature flags are on for the active organization, read-only.
    - [Waitlist signup](https://bettersupabase.com/docs/registry/ui-recipes/waitlist-signup.md): An email form that joins the waitlist and shows the position in line.
    - [Contact detail](https://bettersupabase.com/docs/registry/ui-recipes/contact-detail.md): A person or company with its details, related contacts and the latest activity.
    - [Deal board](https://bettersupabase.com/docs/registry/ui-recipes/deal-board.md): Deals as cards in pipeline stage columns, moved by drag and drop.
    - [Sequence builder](https://bettersupabase.com/docs/registry/ui-recipes/sequence-builder.md): Each sequence's email, wait and task steps in order, with its enrollment counts, an Add step dialog and an Activate or Pause button.
    - [Activity timeline](https://bettersupabase.com/docs/registry/ui-recipes/activity-timeline.md): Calls, emails and meetings with a contact, newest first.
    - [Quote builder](https://bettersupabase.com/docs/registry/ui-recipes/quote-builder.md): A quote with line items, discounts and totals in minor units, sent for acceptance.
    - [Targets progress](https://bettersupabase.com/docs/registry/ui-recipes/targets-progress.md): Sales targets for the period with the progress toward each one.
    - [Contract renewals](https://bettersupabase.com/docs/registry/ui-recipes/contract-renewals.md): Active contracts with their value, end date and notice deadline, the nearest deadline first, so a renewal is decided in time.
    - [Command search](https://bettersupabase.com/docs/registry/ui-recipes/command-search.md): A search dialog over the search index, with favorites and recents before the user types.
    - [Tag input](https://bettersupabase.com/docs/registry/ui-recipes/tag-input.md): A record's tags with suggestions, where typing a name adds a tag or creates it.
    - [Work item board](https://bettersupabase.com/docs/registry/ui-recipes/work-item-board.md): Work items in state columns, ordered by rank and moved through allowed transitions.
    - [Entity form](https://bettersupabase.com/docs/registry/ui-recipes/entity-form.md): A create dialog whose inputs come from `recordForm`: the entity's own fields and the organization's custom fields, validated together by `useRecordForm` before the Server Action runs.
    - [Work item grid](https://bettersupabase.com/docs/registry/ui-recipes/work-item-grid.md): A data grid of work items with filters, sorting and saved views.
    - [Approvals queue](https://bettersupabase.com/docs/registry/ui-recipes/approvals-queue.md): Requests waiting for the caller's decision, with approve and reject buttons.
    - [SLA badges](https://bettersupabase.com/docs/registry/ui-recipes/sla-badges.md): A badge on a record with the time left before its SLA is breached.
    - [Custom fields editor](https://bettersupabase.com/docs/registry/ui-recipes/custom-fields-editor.md): A settings page that adds, orders and removes the custom fields of a record type.
    - [Bulk action bar](https://bettersupabase.com/docs/registry/ui-recipes/bulk-action-bar.md): A bar over a selection of rows that runs an action on all of them and reports failures.
    - [Related items panel](https://bettersupabase.com/docs/registry/ui-recipes/related-items-panel.md): The records linked to a record, with a picker to add or remove a link.
    - [Dispatch board](https://bettersupabase.com/docs/registry/ui-recipes/dispatch-board.md): A week of technicians by day with their scheduled work orders, and the backlog to schedule.
    - [Technician day](https://bettersupabase.com/docs/registry/ui-recipes/technician-day.md): A technician's stops for the day in route order, each with the button that moves it on.
    - [Employee directory](https://bettersupabase.com/docs/registry/ui-recipes/employee-directory.md): A searchable list of employees with an org chart of who reports to whom.
    - [Hiring board](https://bettersupabase.com/docs/registry/ui-recipes/hiring-board.md): Candidates for an opening as cards in interview stage columns.
    - [Timesheet](https://bettersupabase.com/docs/registry/ui-recipes/timesheet.md): A week of time entries per project with a running timer and totals.
    - [Plan picker](https://bettersupabase.com/docs/registry/ui-recipes/plan-picker.md): The plans with their prices and a checkout button each. Checkout starts in a server action or API route that holds the Stripe key, and the client opens the URL it returns.
    - [Usage meter](https://bettersupabase.com/docs/registry/ui-recipes/usage-meter.md): This period's usage per meter against the plan's quota, with the reset date.
    - [Feature gate](https://bettersupabase.com/docs/registry/ui-recipes/feature-gate.md): Content shown only when the active organization's plan includes a feature, read from the session's features claim and updated when the session refreshes.
    - [Shipment tracking](https://bettersupabase.com/docs/registry/ui-recipes/shipment-tracking.md): Shipments with their status and the tracking timeline of the selected one, newest event first.
    - [Invoices table](https://bettersupabase.com/docs/registry/ui-recipes/invoices-table.md): The organization's invoices with their status, amount and a link to the PDF.
    - [Product catalog grid](https://bettersupabase.com/docs/registry/ui-recipes/product-catalog-grid.md): Products in a grid with prices, variants and a filter by collection.
    - [Inventory table](https://bettersupabase.com/docs/registry/ui-recipes/inventory-table.md): Stock levels per product and location, with a form to adjust a count.
    - [Order detail](https://bettersupabase.com/docs/registry/ui-recipes/order-detail.md): An order with its lines, totals, payment state and fulfillment steps.
    - [Kitchen display](https://bettersupabase.com/docs/registry/ui-recipes/kitchen-display.md): Open tickets per kitchen station, each line moved from queued to served, refreshed over Realtime.
    - [Order state board](https://bettersupabase.com/docs/registry/ui-recipes/order-state-board.md): Today's kitchen orders in preparation-state columns; dragging an order forward moves all of its lines.
    - [Promotion code field](https://bettersupabase.com/docs/registry/ui-recipes/promotion-code-field.md): A field that checks a promotion code and shows the discount it gives.
    - [Calendar view](https://bettersupabase.com/docs/registry/ui-recipes/calendar-view.md): A month and week calendar of events with a dialog to add one.
    - [Booking page](https://bettersupabase.com/docs/registry/ui-recipes/booking-page.md): A public page that shows open slots and books one without overlaps.
    - [Availability editor](https://bettersupabase.com/docs/registry/ui-recipes/availability-editor.md): Weekly working hours and date overrides that set which slots can be booked.
    - [Reminders list](https://bettersupabase.com/docs/registry/ui-recipes/reminders-list.md): The next events with the caller's reminders on each, to add a reminder at an offset before an event or remove one.
    - [Grants editor](https://bettersupabase.com/docs/registry/ui-recipes/grants-editor.md): The grants on a drive item, inherited ones included, with a picker to share it with a member or team at a role.
    - [Undo toast](https://bettersupabase.com/docs/registry/ui-recipes/undo-toast.md): A toast after a delete with a button that restores the record from the trash.
    - [Drive explorer](https://bettersupabase.com/docs/registry/ui-recipes/drive-explorer.md): Folders and files with upload, rename, move and a breadcrumb trail, each file with its labels and the approval of its current version.
    - [Version history](https://bettersupabase.com/docs/registry/ui-recipes/version-history.md): The saved versions of a record with a diff and a button to restore one.
    - [Trash bin](https://bettersupabase.com/docs/registry/ui-recipes/trash-bin.md): Deleted records with buttons to restore them or delete them for good.
    - [Form builder](https://bettersupabase.com/docs/registry/ui-recipes/form-builder.md): An editor for form fields and a preview, with the responses in a table.
    - [Course outline](https://bettersupabase.com/docs/registry/ui-recipes/course-outline.md): A course's modules and lessons in rank order, with the caller's progress, certificate and an Enroll button.
    - [Lesson player](https://bettersupabase.com/docs/registry/ui-recipes/lesson-player.md): One lesson's content with a Mark as done button, or its quiz, which the database grades on submit.
    - [CSV import wizard](https://bettersupabase.com/docs/registry/ui-recipes/csv-import-wizard.md): A stepper that uploads a CSV, maps its columns, validates the rows and imports them.
    - [Templates gallery](https://bettersupabase.com/docs/registry/ui-recipes/templates-gallery.md): Templates in a grid with a preview and a button to create a record from one.
    - [Document editor](https://bettersupabase.com/docs/registry/ui-recipes/document-editor.md): A rich text editor for a document with autosave, collaborators and a suggestion mode that editors accept or reject.
    - [Chat with history](https://bettersupabase.com/docs/registry/ui-recipes/chat-with-history.md): An AI chat that stores every message, resumes a stored conversation and streams the reply.
    - [Knowledge base upload](https://bettersupabase.com/docs/registry/ui-recipes/knowledge-upload.md): A form that adds a document to the knowledge base, which chunks and embeds it for search.
    - [Agent activity](https://bettersupabase.com/docs/registry/ui-recipes/agent-run-trace.md): The agent runs for the organization with their steps and the approvals that wait for a person.
    - [AI task queue](https://bettersupabase.com/docs/registry/ui-recipes/ai-task-queue.md): A table of scheduled AI prompts with each task's next run and latest run status, plus pause and resume.
    - [AI provider settings](https://bettersupabase.com/docs/registry/ui-recipes/ai-provider-settings.md): A settings card that lists the organization's own AI provider keys and models, adds a key to Vault and removes one.
    - [Workflow canvas](https://bettersupabase.com/docs/registry/ui-recipes/workflow-canvas.md): A node editor for a workflow definition that saves drafts, publishes versions and runs the workflow.
    - [Workflow runs](https://bettersupabase.com/docs/registry/ui-recipes/workflow-runs.md): The latest workflow runs with their status, which update while a run is in progress.
    - [Connector credentials](https://bettersupabase.com/docs/registry/ui-recipes/connector-setup.md): A sheet that stores a connector credential encrypted and revokes it, without reading the secret back.
    - [Rule builder](https://bettersupabase.com/docs/registry/ui-recipes/rule-builder.md): A condition tree with field, operator and value rows, nested And and Or groups, drag to reorder and a fixed first condition, saved as a versioned rule.
    - [Job runs table](https://bettersupabase.com/docs/registry/ui-recipes/job-runs-table.md): The latest background job runs with their status, attempts and error, and a button to retry a failed run.
    - [API keys table](https://bettersupabase.com/docs/registry/ui-recipes/api-keys-table.md): The organization's API keys, with a form that creates one and shows its token once, and a revoke button per key.
    - [Webhook endpoints](https://bettersupabase.com/docs/registry/ui-recipes/webhook-endpoints.md): The organization's webhook endpoints with their recent deliveries and a retry button.
    - [Service principals table](https://bettersupabase.com/docs/registry/ui-recipes/service-principals-table.md): Machine identities with their scopes, last use and a button to disable one.
    - [Signing keys rotation](https://bettersupabase.com/docs/registry/ui-recipes/signing-keys-rotation.md): The active and previous signing keys with a button to rotate them.
    - [Status page](https://bettersupabase.com/docs/registry/ui-recipes/status-page.md): A public status page: the overall status, each public component with its daily uptime, and the public incident updates.
    - [Audit log table](https://bettersupabase.com/docs/registry/ui-recipes/audit-log-table.md): The audit trail, newest first, with filters by actor and action and older pages on demand.
    - [Support session banner](https://bettersupabase.com/docs/registry/ui-recipes/support-session-banner.md): A banner that tells the user a support agent is viewing the app as them, rendered on the server.
    - [Metrics dashboard](https://bettersupabase.com/docs/registry/ui-recipes/metrics-dashboard.md): A card per metric: the 30-day total against the 30 days before, with daily bars.
    - [Data export and delete](https://bettersupabase.com/docs/registry/ui-recipes/data-export-delete.md): Buttons to export the caller's data and to request account deletion, with the request status.
    - [Control posture](https://bettersupabase.com/docs/registry/ui-recipes/control-posture.md): One card per compliance framework with its passing, failing and not started controls, then the overdue evidence tasks.
    - [Record grid](https://bettersupabase.com/docs/registry/ui-recipes/record-grid.md): An app table as a data grid with search, filters, saved views and bulk actions on the selected rows, including Set field through `appTables.set`.
    - [Record form](https://bettersupabase.com/docs/registry/ui-recipes/record-form.md): A create form whose inputs follow each column: a length limit for text, a select for options, a date input and a searchable picker for references.
    - [Record page](https://bettersupabase.com/docs/registry/ui-recipes/record-page.md): One row as a page: its fields, the rows that reference it, and comments and tags once the table is a subject.
    - [Record board](https://bettersupabase.com/docs/registry/ui-recipes/record-board.md): An app table as a board with a column per option value, where dragging a card writes the value and its rank.
    - [Record calendar](https://bettersupabase.com/docs/registry/ui-recipes/record-calendar.md): Rows on a month grid by a date column, with the month in the URL and a count of rows without a date.
    - [Record timeline](https://bettersupabase.com/docs/registry/ui-recipes/record-timeline.md): Rows as bars from a start date to an end date over four weeks, with a lane per assignee.
    - [Record Gantt chart](https://bettersupabase.com/docs/registry/ui-recipes/record-gantt.md): A row per record grouped by its parent, with a bar for its planned dates and a marker for rows without dates.
    - [Record history](https://bettersupabase.com/docs/registry/ui-recipes/record-history.md): Every version `subject.versions` kept of a row, with the fields each one changed and a restore per field.
    - [Upsert import](https://bettersupabase.com/docs/registry/ui-recipes/upsert-import.md): Paste CSV, map its columns, preview the rows it creates and changes, then upsert them on one of the table's unique sets.

## Reference

- [Reference](https://bettersupabase.com/docs/reference.md): The CLI, extension points, standards and the changelog.
- CLI
  - [CLI](https://bettersupabase.com/docs/cli.md): Codegen, SQL and diagnostics for better-supabase projects.
  - [init and add](https://bettersupabase.com/docs/cli/init.md): Scaffold the config, the data layer and framework glue for your project, start from a preset, and add blocks.
  - [Presets and blocks](https://bettersupabase.com/docs/cli/presets.md): Apply a preset to an existing project, map blocks onto tables it already has, read a preset or design, and find the blocks to add.
  - [gen](https://bettersupabase.com/docs/cli/gen.md): Generate database types, typed models, relation metadata and validators.
  - [dev](https://bettersupabase.com/docs/cli/dev.md): Env files, a command with the stack's env, signing keys, and the local stacks.
  - [db](https://bettersupabase.com/docs/cli/db.md): Run SQL files and typed seeds against the local stack or another database, and diff the schema into a migration.
  - [spec](https://bettersupabase.com/docs/cli/spec.md): Write, check and validate the OpenAPI, AsyncAPI and Arazzo documents your defineApi module renders, with a content-hash cache, watch mode and a diagnostics manifest.
  - [doctor](https://bettersupabase.com/docs/cli/doctor.md): Security, performance and drift checks for your database, config.toml and env files.
  - [codemod](https://bettersupabase.com/docs/cli/codemod.md): Rewrite imports, calls and config keys for renamed better-supabase APIs after an upgrade.
  - [Agent mode](https://bettersupabase.com/docs/cli/agent-mode.md): What the CLI does differently when a coding agent runs it, and how an agent hands a decision back to the user.
  - [MCP server](https://bettersupabase.com/docs/cli/mcp.md): Serve the CLI to a coding agent as an MCP server on stdio, read-only by default, with file writes behind the user's consent.
  - [Shell completion](https://bettersupabase.com/docs/cli/completion.md): Tab completion for bash, zsh and fish, for both better-supabase and bsb.
  - [Errors](https://bettersupabase.com/docs/cli/errors.md): What each CLI error code means, its exit code, and how to fix it.
  - [Configuration](https://bettersupabase.com/docs/cli/config.md): better-supabase.config.ts options and defaults.
- Extending
  - [Writing plugins](https://bettersupabase.com/docs/extending/plugins.md): Plugin API v1, its hooks, and typed repository extensions.
  - [Custom repositories](https://bettersupabase.com/docs/extending/repositories.md): Domain methods with defineRepository and extend, and the escape hatches below them.
  - [Extending blocks](https://bettersupabase.com/docs/extending/blocks.md): Add your own columns to a block's table, steer its methods with hooks, wrap its transport and add methods, without forking the block.
  - [Extension interfaces](https://bettersupabase.com/docs/extending/interfaces.md): The interfaces better-supabase is built on, their first-party implementations and how to plug in your own.
  - [Authorizers](https://bettersupabase.com/docs/extending/authorizers.md): The runtime authorization decision point that resources, actions, route guards and MCP tools ask for their permission, in the AuthZEN request model, failing closed.
  - [Authorization providers](https://bettersupabase.com/docs/extending/authorization-providers.md): Let another authorization system answer permission checks in the SQL modules, bucket and topic policies, API keys and doctor, through one versioned config key.
  - [Document formats](https://bettersupabase.com/docs/extending/document-formats.md): Render the API model to a standard better-supabase does not ship, such as a Postman collection or a GraphQL schema, with defineDocumentFormat and testDocumentFormat.
  - [Credentials](https://bettersupabase.com/docs/extending/credentials.md): Third-party tokens behind a credential reference, resolved by a CredentialProvider over Supabase Vault or Vercel Connect.
  - [Add a credential provider](https://bettersupabase.com/docs/extending/credential-providers.md): Write a CredentialProvider for Nango, Composio or a cloud secret manager, route refs to more than one provider, and check it with the conformance kit.
  - [Add another SDK](https://bettersupabase.com/docs/extending/add-an-sdk.md): The converter, stream and engine contracts an adapter for TanStack AI, LangChain, the OpenAI SDK or Temporal implements to use the AI and workflow blocks.
  - [Events](https://bettersupabase.com/docs/extending/events.md): Observe queries, mutations, errors, auth and refreshes with betterSupabase.on.
  - [Conformance blocks](https://bettersupabase.com/docs/extending/conformance.md): Prove a custom executor, cache adapter, sink, auth resolver, framework adapter, generator or plugin meets its contract.
  - [Stability](https://bettersupabase.com/docs/extending/stability.md): What counts as public API, how it is kept stable and how deprecations work.
- Standards
  - [Standards registry](https://bettersupabase.com/docs/standards.md): Every standard better-supabase follows, where it is used and how mature it is.
  - [OpenAPI](https://bettersupabase.com/docs/standards/openapi.md): OpenAPI 3.0, 3.1 and 3.2 documents, and a 3.3 preview, rendered from one API model built from the generated schema.
  - [Overlay](https://bettersupabase.com/docs/standards/overlay.md): Keep changes to a generated OpenAPI or AsyncAPI document in Overlay 1.0, 1.1 or 1.2 files and apply them on every render.
  - [Arazzo](https://bettersupabase.com/docs/standards/arazzo.md): Arazzo 1.0 and 1.1 workflows over your OpenAPI and AsyncAPI documents, checked against the operations the API has.
  - [AsyncAPI](https://bettersupabase.com/docs/standards/asyncapi.md): An AsyncAPI 3.0 or 3.1 document for Realtime table changes, broadcast topics, CloudEvents and webhooks, rendered from the same API model as OpenAPI.
  - [AuthZEN](https://bettersupabase.com/docs/standards/authzen.md): How the Authorizer interface follows the AuthZEN Authorization API 1.0 information model, and what the conformance test checks.
  - [OpenTelemetry](https://bettersupabase.com/docs/standards/otel.md): Database spans, metrics and trace propagation with the OpenTelemetry conventions.
  - [CloudEvents](https://bettersupabase.com/docs/standards/events.md): Mutations as CloudEvents 1.0, for queues, buses and webhooks.
  - [Webhooks](https://bettersupabase.com/docs/standards/webhooks.md): Standard Webhooks verification, typed Supabase Auth hooks and database webhook payloads.
- [Supabase packages](https://bettersupabase.com/docs/supabase-packages.md): Which Supabase packages better-supabase builds on, how each one is installed and which docs page covers it.
- [For AI agents](https://bettersupabase.com/docs/for-ai-agents.md): Agent Skills, llms.txt, Markdown pages and a docs MCP server that help coding agents use better-supabase correctly.
- [Roadmap](https://bettersupabase.com/docs/roadmap.md): What better-supabase is building now, next and later, with the upstream source each item follows and the subpath it lands in.
- [Changelog](https://bettersupabase.com/docs/changelog.md): Every better-supabase release with its changes, newest first, built from the CHANGELOG.md at the repository root.

## Optional

- [Full documentation](https://bettersupabase.com/llms-full.txt): every page in one Markdown file
- [Blocks catalog](https://bettersupabase.com/blocks.md): every SQL block by category, each linked to its own Markdown page
- [Recipes](https://bettersupabase.com/recipes.md): UI for the blocks from shadcn components and the React hooks, for Next.js and Expo
- [Docs MCP server](https://bettersupabase.com/mcp): Streamable HTTP, read-only tools search_docs, get_page and list_pages
