Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Supabase Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-supabase-knowledge-patch-nevaberry-plugins)
---
name: supabase-knowledge-patch
description: Supabase
version: null
license: MIT
metadata:
author: Nevaberry
---
# Supabase knowledge patch
Load this skill when implementing or updating Supabase authentication, database
access, Edge Functions, Realtime, Storage, local development, deployment,
integrations, or self-hosting. Use the quick references below for compatibility
changes, then open the topic reference for complete conditions and examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [Authentication and keys](references/auth-and-keys.md) | OAuth server and providers, passkeys, MFA, hooks, JWT signing, API keys, SSR |
| [Clients, tools, and MCP](references/clients-tools-and-mcp.md) | Query types, frameworks, developer tools, MCP scope, authentication, and operations |
| [Cron, queues, and integrations](references/cron-queues-and-integrations.md) | Scheduling, queue RPCs, BigQuery pipelines, Management API, Marketplace, foreign data |
| [Database and Data API](references/database-and-data-api.md) | Exposure, grants, PostgREST, poolers, timeouts, extensions, upgrades |
| [Edge Functions](references/edge-functions.md) | JWT checks, CORS, deployment, runtime limits, files, inference, debugging |
| [Local CLI and branching](references/local-cli-and-branching.md) | CLI migration, config, stacks, schemas, seeds, tests, branches, deployment |
| [Platform administration and security](references/platform-administration-and-security.md) | Organization access, backups, networking, replicas, logs, compliance |
| [Realtime](references/realtime.md) | Authorization, Broadcast, replay, Postgres Changes, Presence, protocols, quotas |
| [Self-hosting](references/self-hosting.md) | Docker upgrades, secrets, proxies, service settings, Storage migration |
| [Storage, AI, and vectors](references/storage-ai-and-vectors.md) | Object operations, uploads, Iceberg, Vector buckets, embedding pipelines |
## CLI migration and removed interfaces
In CLI v3, database push/pull/dump, migration fetch/list/repair/squash, database
inspection, type generation, and Storage ls/cp/mv/rm default to local. Use bare
`--remote` for the linked project or the project named by `SUPABASE_PROJECT_ID`;
`--remote=<value>` accepts a project ref, linked branch name, or Postgres URL.
```sh
supabase db pull add_profiles --remote
supabase gen types --remote=preview
```
Migrate `--linked`, `--project-ref`, `--db-url`, and the `gen types --project-id`
flag to `--remote` for these target-selecting commands. Deprecated flags conflict
with `--remote=<value>`, and `--local` now only emits a warning.
CLI v3 prompts before hosted writes. Pass `--yes` for unattended or structured
output runs; piped input and `.env` values for `SUPABASE_YES` cannot confirm them.
`db pull` can update hosted migration history and therefore require confirmation.
For hosted workflows, replace `db remote commit` with `db pull --remote` and
`db remote changes` with `db diff --remote`. Replace `db branch` subcommands with
`branches`. For `functions download`, replace `--legacy-bundle` with `--use-api`.
Rename `[inbucket]` and its remote blocks to `[local_smtp]`; replace `INBUCKET_URL`
with `MAILPIT_URL`. Move `[experimental].orioledb_version` to `[db].orioledb_version`.
For function-local import maps, use `deno.json` or explicitly set
`functions.<slug>.import_map`. The CLI reference contains the remaining removals.
From CLI v3.4, `supabase init` creates `config.jsonc`; tooling needs to recognize
TOML, JSON, and JSONC. Use `supabase config validate` with `--resolve-env` to check interpolated values.
`config convert` converts TOML to JSONC and removes the TOML original; use
`--dry-run` to preview. `--to toml` converts back and keeps JSONC as a `.bak` file.
## Auth and API compatibility changes
Auth v2.198.0 limits OAuth server access tokens to OAuth endpoints and read-only
user access. Switch OAuth clients to `GET /oauth/userinfo` before the temporary
compatibility allowance for `GET /user`, including `auth.getUser()`, is removed.
Account mutation and other restricted Auth endpoints return HTTP 403 with
`no_authorization`; the Auth reference lists the affected paths.
Verifying a password recovery link or OTP clears the old password in Auth
v2.198.0. Prompt the user to set a new password from the recovery session.
Legacy sessions whose `aal` is null are invalidated; affected users must sign in
again. Password minimum length uses Unicode code points.
New projects default to explicit grants for new `public` tables. Grant API roles
the required operations, then use RLS policies to determine row access.
Dashboard-created tables enable RLS by default; enable it explicitly for tables
created through SQL or migrations. New projects must enable `pg_graphql` explicitly.
Fetch `GET /rest/v1/` from server-side code with a secret API key or legacy
`service_role` key. An `anon` key receives `Access to schema is forbidden`.
Extension versions explicitly specified in `CREATE EXTENSION` or
`ALTER EXTENSION` are ignored with a warning in favor of the default version.
Before a hosted Postgres 17 upgrade, drop `pgjwt`, `plv8`, and `timescaledb`.
First migrate TimescaleDB hypertables to native partitions and replace its
specific queries and policies. Planned `pgsodium` deprecation concerns direct
usage; existing Vault callers can continue using its SQL API.
Use `storage.objects.owner_id` for ownership checks; `owner` is deprecated.
Update Management API log clients using `analytics/endpoints/logs.all` to the
replacement logs endpoint.
## Keys, sessions, and request authorization
Send `sb_publishable_...` or `sb_secret_...` in `apikey` and the signed-in user's
JWT in `Authorization: Bearer ...`. Secret-key requests use `service_role`,
which bypasses RLS; browser requests with secret keys return HTTP 401.
Rotate an opaque secret by creating its replacement, switching callers, and
deleting the old key. Check last-used indicators before disabling legacy keys.
Before rotating JWT signing keys, update verification that depends on the legacy
secret and refresh custom JWKS consumers. Previous keys stay trusted until
revocation. Allow for outstanding JWT expiry and JWKS caches: 10 minutes at the
edge and potentially 10 more in the client. Revoking the legacy secret requires
migration to publishable/secret API keys and disabling legacy API keys.
For an Edge Function using the legacy gateway JWT check, opaque keys require
`--no-verify-jwt` and authorization inside the function. The gateway skips the
`apikey` check in this mode. Validate bearer tokens with `auth.getClaims(token)`
before using their claims.
In SSR, use `auth.getClaims()` to verify the project's access token and
`auth.getUser()` when the decision requires current server-side session state.
From `@supabase/ssr` 0.10.0, forward `Cache-Control`, `Expires`, and `Pragma` from
the second argument of `cookies.setAll` on the response carrying refreshed cookies.
OAuth scopes control ID token and UserInfo claims. OAuth access tokens inherit
the user's data permissions; restrict client access with `auth.jwt()->>'client_id'`,
using a restrictive policy when existing permissive policies already grant access.
## Realtime subscriptions, replay, and limits
Register `postgres_changes` handlers before `.subscribe()`; Realtime rejects
new Postgres Changes listeners on a joined channel. Postgres Changes uses the
source table's RLS. A channel's `private` option governs Broadcast and Presence.
Private channels use `SELECT` policies on `realtime.messages` for receiving and
`INSERT` policies for sending or tracking. Match `realtime.topic()` and the
`broadcast` or `presence` extension. Existing RLS policies still apply even though
creating, altering, or dropping objects in the protected `realtime` schema fails.
Reconnect or send an `access_token` message with a fresh JWT to pick up permission
changes. An explicit `realtime.setAuth(jwt)` override survives channel removal and
resubscription; call `setAuth()` without an argument to resume the client's token source.
Broadcast Replay is public alpha for database broadcasts on private channels.
Use Unix milliseconds for `since` and inspect `meta.replayed` in callbacks.
Realtime v2.176.0 raises the maximum replay size to 200 messages; set
`config.broadcast.replay.limit` accordingly. Invalid persistence TTL errors use
`persistence_invalid_ttl` starting in v2.151.4, replacing `invalid_persist_ttl`.
Realtime v2.177.1 removes the legacy joins-per-second limit. Socket and node join
budgets have separate refusal behavior, and Broadcast backlog and Presence limits
have changed; consult the Realtime reference for their version-specific behavior.
## Edge Functions and deployment
Use SDK `corsHeaders` from the `/cors` export in preflight, success, and error
responses. The experimental local gateway no longer adds
`Access-Control-Allow-Origin: *` for `/functions/v1`; the function supplies CORS.
`EdgeRuntime.waitUntil(promise)` allows background work after the response,
subject to worker limits. Set `policy = "per_worker"` under `[edge_runtime]` locally for
background work and persistent WebSockets; restart `supabase functions serve`
to pick up edits in that mode.
Hosted workers have 256 MB memory and 2 seconds of CPU per request excluding
async I/O. Worker lifetime is 150 seconds on Free or 400 seconds on paid plans;
the separate 150-second idle timeout returns 504 when no response is sent.
Keep `deno.json` and private-registry `.npmrc` files in each function directory.
The CLI falls back to API deployment without Docker; `--use-api` forces it.
Static-file bundling requires a Docker-backed CLI deployment.
Production Git deployment applies new migrations and the Edge Functions and
Storage buckets declared in configuration by default. Deploy API settings, Auth
settings, and seed data separately. Preview branches seed once at creation and
start without production data; recreation discards data written to the old preview.
## Storage, vectors, and queues
Set `upsert: true` when creating a signed upload URL to permit overwrites with
its token. For TUS, use the direct Storage resumable endpoint and 6 MiB chunks;
send the signed upload token in `x-signature`. TUS URLs last up to 24 hours.
Storage Analytics and Vector client namespaces are public alpha. Analytics
buckets use Iceberg; populate them with your own ingestion pipeline following
removal of managed replication into them. Vector index dimension, distance
metric, or data type changes require a replacement index; write in batches of 500.
For embedding updates, enqueue from row-level insert/update triggers through
`pgmq`, then use `pg_cron` and `pg_net` to send batches to an Edge Function.
List all input columns in `UPDATE OF` to avoid requeueing the embedding write.
Delete each queue message only after writing its embedding. A worker can return
HTTP 200 with failed jobs: inspect `x-failed-jobs` and `net._http_response`.
Queue Data API access uses `pgmq_public`; enable the wrappers, RLS on queue
tables, and matching role permissions. The queue reference covers visibility
timeouts, long polling, batch archive/delete, and archive retention.
## MCP and operational workflows
Scope hosted MCP with `project_ref`, `read_only=true`, and `features`.
Storage tools are opt-in, and experimental Branching requires a paid plan.
Read-only mode removes mutating tools from discovery. Use `apply_migration` for
DDL and `execute_sql` for queries that leave the schema intact.
Hosted MCP uses the developer's permissions for internal use. Use
`@supabase/mcp-server-postgrest` for application users through the app's REST API.
For new projects or branches, `get_cost` retrieves the estimate and `confirm_cost`
records the user's acknowledgment before creation.
Database network restrictions cover direct and pooled Postgres connections;
HTTPS APIs remain accessible. Each allowlist update replaces the full list.
Physical backups and PITR do not provide a downloadable logical dump; use a
manual logical dump when one is needed.
For Docker upgrades, merge configuration changes as well as updating images.
Apply the matching Compose, gateway, and mounted service configuration changes.
The self-hosting reference covers opaque keys, hybrid function verification,
private MCP access, and migration of Storage objects and hosted data.