mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
create-pull-request/patch
2543
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ce80792683 | feat(docs): Improve Pipelines docs (#54045) | ||
|
|
af75c3f8d9 |
Change deprecation notice in docs to mention early 2027 (#54052)
A notice was added in the Project's Settings -> API Keys page via [pull request 52250](https://github.com/supabase/supabase/pull/52250) that mentions `Legacy API keys will be retired in early 2027` but the notice in the docs still mentions `Supabase is deprecating the anon and service_role keys by the end of 2026`. This pull request updates the docs to be consistent with the Dashboard UI to avoid confusion. |
||
|
|
7960616cf9 |
fix(docs): use the sub claim in the storage copy/move policy examples (#53953)
Fixes #53952 ## What changed The Copy and Move Objects guide has three RLS policy examples that compare `storage.objects.owner_id` (`text`) and the output of `storage.foldername()` (`text[]`) with `auth.uid()` (`uuid`). Postgres has no implicit cast between `text` and `uuid`, so any query governed by these policies fails with `operator does not exist: text = uuid`. This PR changes the comparisons to use `auth.jwt()->>'sub'`, matching the pattern already used in the storage access control and delete objects guides. ## Verification - Reproduced the original error against a local Postgres instance. - Confirmed the corrected expressions run without errors. - No links or anchors changed. I used AI to help debug and verify this against a local Postgres instance, and I personally reviewed the final change. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
a1616e0076 |
docs(cli): supabase init creates config.jsonc for new projects (#53857)
## Problem Since CLI 3.4.0 (released 2026-11-24), `supabase init` creates `supabase/config.jsonc` for new projects instead of `supabase/config.toml`. The file starts with a `$schema` key, so editors get validation and autocomplete straight away. Projects that already have a `config.toml` aren't touched, and the CLI keeps reading it the same way. A handful of guides still say `init` creates `config.toml`. ## Solution - `cli/config-formats.mdx`: the file table marks `config.jsonc` as the one `init` creates in CLI 3.4.0 and later, and the "Minimum CLI version" section says earlier versions create `config.toml`. Under the table there's a short line saying a `config.toml` project keeps working, and pointing at `supabase config convert --to toml` for anyone who wants TOML. The schema section says `init` writes the `$schema` key into `config.jsonc`, rather than the TOML `#:schema` line. - `cli/getting-started.mdx`: the setup admonition and the `supabase init` step name `config.jsonc`, and the step mentions `config convert --to toml` with a link to Config file formats. - `managing-config.mdx`, `cli-workflows.mdx` (step 1 and the key commands table) and `running-multiple-local-projects.mdx` (the `SUPABASE_EXPERIMENTAL_STACK=1 supabase init` bit) had the same "init creates `config.toml`" statement, so I've updated those too. I've left the many "edit `supabase/config.toml`" references across the other guides alone - they're about where a setting lives rather than what `init` creates, and the per-format config examples cover them. ## Review instructions 1. Open Config file formats, CLI getting started, Managing config and Local development workflow on the preview. 2. Check they say `supabase init` creates `config.jsonc` (CLI 3.4.0 and later), and that `config.toml` projects are described as still working. 3. Check the `--to toml` links land on the "Convert back to TOML" section. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
0fa521d64a |
chore: small nano compute docs improvements (#54005)
Make it a bit clearer that Nano instances are for Free Plan and not free in itself |
||
|
|
36e370aa5c |
docs(ai): explain how hnsw.ef_search caps HNSW results and how to set it (#53997)
## Problem The HNSW tuning section said only that a higher `ef_search` gives better accuracy and slower queries. A reader whose query uses a `limit` above `ef_search` gets fewer rows back. The docs didn't explain why, what the range is, or how to change the setting. Related to [FDBKIN-12895](https://linear.app/supabase/issue/FDBKIN-12895/document-performance-trade-offs-of-pgvectors-hnsw-ef-search-parameter) Closes [DOCS-1800](https://linear.app/supabase/issue/DOCS-1800/explain-that-hnswef-search-caps-hnsw-results-and-how-to-set-it) ## Solution The `ef_search` bullet on the "Going to production" guide now names the `hnsw.ef_search` setting, its default, and its valid range. Plain paragraphs after the list explain how it caps the rows an HNSW scan returns and how to set it. They cover a session, one transaction, a transaction-mode pooler, and a database function called through the Data API. They also point to iterative index scans for returning more rows, and don't repeat that explanation. The filtering section of the HNSW indexes page now names `hnsw.ef_search` as the limit, so the two pages agree. ## How to verify 1. Open https://docs-git-tedd-docs-1800-supabase.vercel.app/docs/guides/ai/going-to-prod#hnsw-understanding-efconstruction--efsearch--and-m and https://docs-git-tedd-docs-1800-supabase.vercel.app/docs/guides/ai/vector-indexes/hnsw-indexes#filtering-with-hnsw-indexes. 2. The `ef_search` bullet states the `hnsw.ef_search` default (40) and range (1 to 1,000), and stays one paragraph like the `m` and `ef_construction` bullets. 3. A paragraph after the list says that without iterative index scans, an HNSW index scan returns at most `ef_search` rows, even when the query's `limit` is larger. 4. A SQL block shows a `set` statement and a `set local` statement inside `begin` / `commit`. A second SQL block shows a database function with a `set hnsw.ef_search = 100` clause. 5. The paragraph about setting the value links to "Transaction mode limitations" and to "Querying a vector / embedding", and both links land on those sections. 6. A paragraph links to "Filtering with HNSW indexes", and the link lands on that section. 7. In "Filtering with HNSW indexes", the sentence about selective filters names `hnsw.ef_search` as the limit on rows a scan returns, and its link lands on the going-to-prod HNSW section. ## Checks Ran `pnpm turbo run typecheck`, `pnpm turbo run lint`, and `pnpm exec oxfmt --check` on the changed docs. Ran both SQL blocks in page order on Postgres 18 with pgvector 0.8.1, against 20k random vectors with an HNSW `vector_l2_ops` index and `vector` installed in the `extensions` schema. At the default, `limit 100` returned 40 rows. With `set` or `set local hnsw.ef_search = 100`, it returned 100 rows. The `set local` value reset after `commit`, and `1001` was rejected as outside 1..1000. The function with `set hnsw.ef_search = 100` returned 100 rows for `limit 200`, and the session value stayed at 40. At `ef_search = 1000`, `limit 1500` returned 1000 rows, and 1500 after `set hnsw.iterative_scan = relaxed_order`. Docs tests skipped: they need Docker. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1800](https://linear.app/supabase/issue/DOCS-1800/explain-that-hnswef-search-caps-hnsw-results-and-how-to-set-it). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
528e2d0a98 |
docs(self-hosting): explain how Edge Functions workers are reused across requests (#53996)
## Problem The self-hosted Functions guide lists worker timeouts and idle cleanup, but never says that a running worker serves later requests. The Docker guide says the main worker loads each function from disk per request, which suggests top-level setup runs on every request. Related to [FDBKIN-22732](https://linear.app/supabase/issue/FDBKIN-22732/clarify-edge-functions-worker-lifecycle-and-reuse-strategy-for-self) Closes [DOCS-1799](https://linear.app/supabase/issue/DOCS-1799/explain-how-self-hosted-edge-functions-reuse-workers-across-requests) ## Solution A new "Worker lifecycle" section on the self-hosted Functions guide explains that the default `per_worker` policy sends requests to a function's running workers. Concurrent cold requests can start up to one worker per CPU, and later requests rotate across them. It says that top-level code runs once per worker, so heavy setup belongs there. It also lists the events that stop a worker from taking new requests, including retirement at half of `workerTimeoutMs`, links to the existing timeout and cleanup sections, and names the settings that keep workers alive longer. The Docker guide's sentence now says that a restart stops running workers, so the next request picks up changed code. ## How to verify 1. Open https://docs-git-tedd-docs-1799-supabase.vercel.app/docs/guides/self-hosting/self-hosted-functions#worker-lifecycle and https://docs-git-tedd-docs-1799-supabase.vercel.app/docs/guides/self-hosting/docker#accessing-edge-functions. 2. The Worker lifecycle section says that requests go to a running worker for the function, that concurrent cold requests might each start a worker up to the number of CPUs, and that later requests rotate across those workers. 3. It says that top-level code runs once per worker, that heavy setup goes at the top level, and that top-level state belongs to one worker. 4. It lists reaching half of `workerTimeoutMs`, no requests, idle-worker cleanup, an error or resource limit, and a service restart as events that stop a worker from taking new requests, and says a new worker starts when the function has none left. The links to Timeout errors, Idle-worker cleanup, Per-worker memory limit, and Container memory budget go to those sections. 5. It names `requestAbsentTimeoutMs` and `workerTimeoutMs` as the settings to raise to keep workers alive longer. 6. The Docker guide no longer says functions load from disk per request, and still says a restart picks up new or changed function code. ## Checks Ran `pnpm turbo run lint typecheck` on the changed packages and `pnpm exec oxfmt --check` on the changed files. Checked the facts against `docker/volumes/functions/main/index.ts` and `docker/docker-compose.yml` in this repo, and against `supabase/edge-runtime` at `v1.79.2` (the compose image tag): `cli/src/flags.rs` (`--policy` default), `crates/base/src/worker/pool.rs` (worker reuse, rotation, concurrent creation, and retirement), `crates/base/src/worker/supervisor/strategy_per_worker.rs` (early retirement at half of the wall-clock limit), and `ext/workers/user_workers.js` (`forceCreate` default). Docs tests need Docker and were skipped. Reuse wasn't tested against a running stack. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have checked that the change follows the docs style guide - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1799](https://linear.app/supabase/issue/DOCS-1799/explain-how-self-hosted-edge-functions-reuse-workers-across-requests). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
74cb5aa97a |
docs(rls): warn that an auth.uid() is null branch exposes every row (#53995)
## Problem The RLS guide explains that `auth.uid()` is `null` for a request without a user, but not what happens when a policy tests for `null` on purpose. A condition such as `auth.uid() is null or auth.uid() = user_id` returns every row to such a request. The guide also never says which roles a policy with no `to` clause applies to. Related to [FDBKIN-31059](https://linear.app/supabase/issue/FDBKIN-31059/update-rls-documentation-to-warn-against-common-anon-leak-policy) Closes [DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row) ## Solution The `auth.uid()` section of the RLS guide now states in body text when `auth.uid()` is `null` and what an owner comparison returns then. A `danger` admonition replaces the old caution: it shows the insecure `is null` branch, explains why `to authenticated` alone doesn't fix it, and gives a safe owner-only policy to copy. "Specify roles in your policies" now says that a policy with no `to` clause applies to `public`, which includes `anon`. The old advice to add `auth.uid() IS NOT NULL AND` is removed, because the plain comparison already returns no rows for such requests. ## How to verify 1. Open https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#authuid and https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#specify-roles-in-your-policies. 2. The `auth.uid()` section says it returns `null` for any request whose JWT has no `sub`, including every `anon` request. 3. A danger admonition warns that an `auth.uid() is null` branch returns every row to such requests, and that `to authenticated` doesn't remove the risk. 4. The admonition ends with a copyable policy that uses `to authenticated` and `(select auth.uid()) = user_id`, with no `is null` branch. 5. "Specify roles in your policies" says a policy with no `to` clause applies to `public`, which every role, including `anon`, is a member of. 6. The new link from "Specify roles in your policies" (`#authuid`) jumps to the `auth.uid()` section. ## Checks Ran `pnpm exec oxfmt --check` on the changed page. ESLint ignores MDX files. Ran both SQL snippets in PGlite 0.4.5 with `anon` and `authenticated` roles, Supabase's `auth.uid()` definition, a two-row table with `select` granted to both roles, and RLS on. With the insecure policy and no `to`, `anon` reads both rows. With `to authenticated`, a request with no `sub` reads both rows. With the safe policy, a user reads only their own row and a request with no `sub` reads none. A policy with no `to` lists `public` in `pg_policies.roles`, which matches the Postgres `CREATE POLICY` docs. `pnpm build:guides-markdown` was not run, because its federated-content step needs GitHub credentials. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
13d1f13107 |
docs(platform): explain what a custom domain is for and that it must be a subdomain (#53993)
## Problem The Custom Domains page didn't say what a custom domain is for. The subdomain-only rule appeared only in the CLI prerequisites. A reader who uses the dashboard, or reads only the intro and Limitations, could think they can't use their own domain. They could also think the add-on hosts their website on the root domain. Related to [FDBKIN-15980](https://linear.app/supabase/issue/FDBKIN-15980/clarify-that-custom-domains-are-for-api-endpoints-not-website-hosting) Closes [DOCS-1797](https://linear.app/supabase/issue/DOCS-1797/explain-that-a-custom-domain-replaces-the-project-api-url-and-must-be) ## Solution The intro now says that a custom domain serves the project's API, alongside the default `<project-ref>.supabase.co` domain, for Auth, Storage, Edge Functions, and other API requests. Limitations now states the subdomain rule for every setup path. It also widens the existing hosting bullet: a custom domain isn't intended for hosting frontend apps, and readers can host their website on the root domain with their own hosting provider. The CLI prerequisite keeps the subdomain step without repeating the rule. The intro says "alongside" rather than "replaces", because the default domain keeps working after activation. The hosting bullet keeps the "not intended" framing, because Edge Functions can serve HTML only on a custom domain. Preview: [Custom domains](https://docs-git-tedd-docs-1797-supabase.vercel.app/docs/guides/platform/custom-domains#limitations) ## Checks Ran `pnpm exec oxfmt --check` on the changed file. Checked facts against the page's activation steps, the Edge Functions limits page, and Studio's custom domain form, which asks for a subdomain. Skipped `pnpm build:guides-markdown`: its `build:federated-content` dependency needs GitHub credentials that the build environment didn't have. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1797](https://linear.app/supabase/issue/DOCS-1797/explain-that-a-custom-domain-replaces-the-project-api-url-and-must-be). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
caf7baaf08 |
docs(auth): show RLS policies that match the Firebase user ID (#53992)
## Problem The Firebase Auth guide sets up the client, the integration, the `role` claim, and the issuer check, but never shows how to limit rows to the signed-in Firebase user. The obvious helper, `auth.uid()`, fails with Firebase UIDs. Related to [FDBKIN-16284](https://linear.app/supabase/issue/FDBKIN-16284/provide-a-clear-process-for-connecting-firebase-auth-to-supabase-rls) Closes [DOCS-1796](https://linear.app/supabase/issue/DOCS-1796/show-how-to-write-rls-policies-that-match-the-firebase-user-id) ## Solution Adds a short "Write RLS policies for Firebase users" section to the Firebase Auth guide. It explains that `sub` holds the Firebase `uid`, shows a select policy that compares a `text` column with `(select auth.jwt()->>'sub')`, and says to use `auth.jwt()->>'sub'` in place of `auth.uid()`, which casts `sub` to `uuid`. The snippet uses the same shape and placeholder as the page's other policies and the custom OIDC guide. It points self-hosters to the restrictive issuer policy. ## How to verify 1. Open https://docs-git-tedd-docs-1796-supabase.vercel.app/docs/guides/auth/third-party/firebase-auth#write-rls-policies-for-firebase-users. 2. The section sits between "Add a new Third-Party Auth integration to your project" and the self-hosting restrictive policy section. 3. The SQL snippet creates a select policy on `table_name` for `authenticated` using `user_id = (select auth.jwt()->>'sub')`. 4. The text says `user_id` must be a `text` column, and to use `auth.jwt()->>'sub'` in place of `auth.uid()`, which fails with `invalid input syntax for type uuid`. 5. The text asks only self-hosters to add the restrictive issuer policy. 6. The links to the RLS guide, the `role` claim section, and the restrictive issuer policy section go to the right headings. ## Checks Ran `pnpm exec oxfmt --check` on the changed file. Checked `auth.uid()` against the `supabase/auth` migration `20220224000811_update_auth_functions.up.sql` (it casts `sub` to `uuid`), and the `sub` claim against Firebase's ID token docs. Skipped `pnpm build:guides-markdown`, which needs GitHub credentials that the build environment didn't have. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1796](https://linear.app/supabase/issue/DOCS-1796/show-how-to-write-rls-policies-that-match-the-firebase-user-id). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
c9a093fa81 |
docs(auth): show the hashed nonce in the Google pre-built HTML example (#53991)
## Problem The Google pre-built HTML example on the Google sign-in guide showed `data-nonce=""`, while the nonce step below it said the nonce must go in that attribute. Readers couldn't tell what value belongs in `data-nonce`, whether the attribute is required, or how to set a value that changes on every sign-in. Related to [FDBKIN-45945](https://linear.app/supabase/issue/FDBKIN-45945/clarify-data-nonce-attribute-in-google-login-documentation-html) Closes [DOCS-1795](https://linear.app/supabase/issue/DOCS-1795/show-where-the-hashed-nonce-goes-in-the-google-pre-built-html-example) ## Solution The HTML example now shows a `<HASHED_NONCE>` placeholder. A line below it says to keep the attribute only when you configure a nonce and to remove it otherwise, because Supabase Auth rejects a sign-in whose ID token has a nonce that `signInWithIdToken` doesn't pass (unless the nonce check is skipped). The "Configure a nonce" step now says the hashed nonce goes in `data-nonce` and the raw nonce in the `nonce` option of `signInWithIdToken`, and explains why: Supabase Auth hashes the raw value and compares it with the token's nonce. The step ends with two ways to set a per-sign-in value from code: write the `g_id_onload` element and then load the Google client script, or pass the hashed nonce to `google.accounts.id.initialize` as the Next.js example does. The nonce-generation snippet itself is unchanged. ## How to verify 1. Open https://docs-git-tedd-docs-1795-supabase.vercel.app/docs/guides/auth/social-sign-in/auth-google#google-pre-built. 2. In the "Your final HTML code might look something like this" example, `data-nonce` shows `<HASHED_NONCE>`, not an empty string. 3. Below that example, the page says to keep `data-nonce` only if you configure a nonce, to remove it otherwise, and that Supabase Auth rejects the sign-in when the ID token has a nonce and `signInWithIdToken` doesn't pass one, unless `Skip nonce check` is enabled. 4. The "Configure a nonce" step says the hashed nonce goes in `data-nonce` and the raw nonce in the `nonce` option of `signInWithIdToken`. 5. The end of that step says to generate the `data-nonce` value in page code and gives two options: write the `g_id_onload` element from code and then load the Google client script in place of the `<script>` tag from the first step, or pass the hashed nonce to `google.accounts.id.initialize`. Its "One-tap with Next.js" link jumps to that section. ## Checks Ran `pnpm exec oxfmt --check` on the changed MDX file; it passes. No code changed, so no typecheck, lint, or tests apply. Checked the hashing rule against Supabase Auth's ID-token grant (`internal/api/token_oidc.go`: SHA-256 of the raw nonce, hex-encoded, compared with the token's `nonce` claim; when the nonce check is not skipped, a token nonce without a passed nonce, or the reverse, fails with "Passed nonce and nonce in id_token should either both exist or not.") and the Google Identity Services HTML reference for `data-nonce` (optional). Did not run the docs build in the sandbox. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have kept the change small and focused - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1795](https://linear.app/supabase/issue/DOCS-1795/show-where-the-hashed-nonce-goes-in-the-google-pre-built-html-example). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
24727bd0bf |
fix(docs): cast the SSO provider claim to uuid in the RLS policy (#53846)
## Problem Fixes #53845. The SAML SSO guide's `organization_settings` RLS example has several problems. - It compares `sso_provider_id` (`uuid`) to `auth.jwt()#>>'{amr,0,provider}'` (`text`), so creating the policy fails with `operator does not exist: uuid = text`. - It reads `amr[0]`. After an MFA step, `amr[0]` can be the MFA entry, which has no `provider`, so the expression returns null and the policy rejects the matching row. - It never enables RLS and shows only a restrictive policy, which does not grant access on its own. ## Solution Make the example self-contained: - Enable RLS on the table. - Add a permissive `SELECT` policy for authenticated users. - Keep a restrictive policy that finds the `sso/saml` entry in `amr`, reads its `provider`, and casts it to `uuid`. - Update the `auth.jwt()` provider reference in the same section to point to this lookup. This keeps the comparison as `uuid = uuid` and does not assume the SSO entry is first. This changes one example and the related `auth.jwt()` reference in one `.mdx` file. ## Verification Tested against `supabase/postgres:17.6.1.143` with the real `auth.jwt()` definition. Before, creating the policy fails: ``` using ( sso_provider_id = (select auth.jwt()#>>'{amr,0,provider}') ); ERROR: operator does not exist: uuid = text ``` After, the policy creates. With the MFA entry first (`amr` has `totp`, then `sso/saml`), the MFA-first SSO user sees only their organization's row. With the SSO entry first, the same user sees the same row. A user without an SSO entry sees no rows. Prettier passes on the file. ## Review instructions 1. Open `apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx`. 2. Confirm the table enables RLS, the example has a permissive `SELECT` policy and a restrictive provider policy, the provider lookup finds the `sso/saml` entry and casts it to `uuid`, and the `auth.jwt()` reference points to that lookup. 3. Run the example against a project or local database, including a user with an MFA entry before the SSO entry. The user should see only their organization's row. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) I used AI to help debug and verify this, but I reviewed the change and am submitting the PR myself. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
1006f3590c |
docs(billing): document the $300 minimum for credit top-ups (#53260)
## Problem The [Credits](https://supabase.com/docs/guides/platform/credits) page lists only the $2,000 maximum per credit top-up. The Dashboard also enforces a $300 minimum ("Amount must be between $300 - $2000"), which isn't documented, and customers have asked about it in support tickets. ## Solution Add the $300 minimum to the first sentence of the "Credit top-ups" section, using the same `<Price>` component as the existing maximum and No other content changes. <img width="1004" height="238" alt="Topup-dialog" src="https://github.com/user-attachments/assets/de3f84db-4a35-43d2-923b-0957b75dfa9d" /> ## Preview links | Site | Live | Preview | Search for | | ---- | ---- | ------- | ---------- | | Docs | [/docs/guides/platform/credits](https://supabase.com/docs/guides/platform/credits) | [/docs/guides/platform/credits](https://docs-git-docs-credit-top-up-minimum-supabase.vercel.app/docs/guides/platform/credits) | with a minimum of | ## Review instructions 1. Open the live and preview links side by side. 2. In "Credit top-ups", check that the first sentence now gives both the $300 minimum and the $2,000 maximum, and that both amounts render correctly. 3. Optionally, open Organization → Billing → Credit Balance → Top Up in the Dashboard and enter an amount below $300 to see the validation message. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> |
||
|
|
8f76606683 |
docs(kotlin): fix outdated API names and ack wording in guides (#53282)
## Problem Some Kotlin snippets in the guides use names supabase-kt renamed in 2.0, so they don't compile with current supabase-kt (3.9.0). The Apple sign-in page also asks for `gotrue-kt`, which has no 3.x release (3.0.0 replaced it with `auth-kt`). And the Kotlin tab of "Acknowledge messages" in the Broadcast guide says `acknowledgeBroadcasts` sends messages back to the sender, which is what `receiveOwnBroadcasts` does. Closes #53281 ## Solution - `passwords.mdx`: `supabase.gotrue.sendRecoveryEmail` → `supabase.auth.resetPasswordForEmail` in the PKCE flow, the same rename #33564 made in the Implicit flow copy. - `auth-apple.mdx`: `gotrue.signInWith(Apple)` → `auth.signInWith(Apple)`, `install(GoTrue)` → `install(Auth)`, `gotrue-kt` → `auth-kt`. - `postgres-changes.mdx`: `realtime.createChannel` → `channel`, and `connect()` + `join()` → `subscribe()`, which connects on its own. That matches the other Kotlin snippets on the page. `connect()` still exists, it just isn't needed here. - `broadcast.mdx`: the Kotlin ack tab now says the servers acknowledge each message, and that on a subscribed channel `broadcast()` doesn't wait for or return the acknowledgment. `acknowledgeBroadcasts` serializes to `ack` in `RealtimeJoinPayload.kt`, while `broadcast()` returns `Unit` and the server's reply is only logged. The renames come from supabase-kt's MIGRATION.md, and I checked each new name against the 3.9.0 source and the Kotlin reference. `/test-the-docs` doesn't run `kotlin` fences, so nothing was executed. The compose-auth snippet on the Apple page has three more compile errors that aren't renames: `result.error` (`NetworkError` only has `message`), `scope`, which is never declared, and `fullName` on `SignInResultData`, which only exposes `credential` on Apple targets. I left those out and can send them separately. ## Review instructions 1. Open the Kotlin tab of each changed snippet on the preview: passwords (PKCE flow, step 3), Apple sign-in, Postgres Changes `neq` filter, Broadcast "Acknowledge messages". 2. Compare the names with the 2.0 and 3.0 sections of supabase-kt's MIGRATION.md and with the Kotlin reference for `resetPasswordForEmail`, `subscribe` and installing. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
3389756a4c |
fix(docs): correct the JWT team policy example (#53777)
## Problem Fixes #53776 We hit this while adding team-scoped RLS to a project from the guide. Creating the policy fails with: ```text ERROR: operator does not exist: uuid = jsonb ``` The example uses `team_id in (select auth.jwt() -> 'app_metadata' -> 'teams')`. `->` returns a single `jsonb` value, so `in (select ...)` compares `team_id` to that jsonb value. ## Solution Expand the claim with `jsonb_array_elements_text`, cast each team ID to `uuid`, and compare it with `= any (array(...))`: ```sql using ( team_id = any ( array( select (jsonb_array_elements_text((select auth.jwt()) -> 'app_metadata' -> 'teams'))::uuid ) ) ); ``` `app_metadata.teams` must be an array of UUID strings, for example `{"app_metadata": {"teams": ["22222222-2222-2222-2222-222222222222"]}}`. Objects such as `[{"id": "..."}]` fail the cast. Comparing UUID to UUID means uppercase values in the claim still match and Postgres can use an index on `team_id`. The guide and the AI prompt in `examples/prompts/database-rls-policies.md` both document the expected claim shape and that `team_id` is a `uuid`; for other ID types, cast the array element to that type instead. ## Review instructions 1. Open the `auth.jwt()` section of the [RLS guide](https://supabase.com/docs/guides/database/postgres/row-level-security#auth-jwt). 2. Run the updated `create policy` statement against Postgres. It should create without error. 3. Check that a user whose `app_metadata.teams` is an array of UUID strings containing the row's `team_id` sees the row, including when the claim uses an uppercase UUID, and that a user without it does not. I checked these steps on Postgres 14. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) I used AI to help debug this. The fix and this pull request are mine; I reviewed the change before opening it. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
9298ed68c1 |
docs(functions): list all supported sync Deno APIs and cover self-hosted workers (#53971)
## Problem The list of synchronous Deno APIs on the Edge Functions ephemeral storage page leaves out three APIs that the runtime allows during initial script evaluation. The self-hosted Functions guide doesn't say whether these limits apply to self-hosted functions, or where to find them. Related to [FDBKIN-8800](https://linear.app/supabase/issue/FDBKIN-8800/document-which-deno-sync-functions-are-supported-in-self-hosted-edge) Closes [DOCS-1762](https://linear.app/supabase/issue/DOCS-1762/list-every-supported-sync-deno-api-and-say-they-apply-to-self-hosted) ## Solution The ephemeral storage page now lists all 12 sync APIs that edge-runtime allows during initial script evaluation, adding `Deno.lstatSync`, `Deno.makeTempFileSync`, and `Deno.copyFileSync`. The self-hosted Functions guide gets a short "Synchronous file APIs" section: user workers get the same init-only rule and the `blocklisted on the current context` error, and the main worker router isn't restricted. It links to the list instead of repeating it. ## How to verify 1. On `/docs/guides/functions/ephemeral-storage`, the "Using synchronous file APIs" list shows 12 APIs, including `Deno.lstatSync`, `Deno.makeTempFileSync`, and `Deno.copyFileSync`. 2. On `/docs/guides/self-hosting/self-hosted-functions`, a "Synchronous file APIs" section says user-worker functions can use these APIs only during initial script evaluation, names the error thrown otherwise, and says the main worker isn't restricted. 3. The link in that section opens the list on the ephemeral storage page, and the self-hosted page doesn't repeat the list. ## Checks Ran `pnpm exec oxfmt --check` on both pages. Checked the API list, the error text, and the `kind === "user"` gate against `ext/runtime/js/bootstrap.js` in `supabase/edge-runtime` at `v1.79.2`, the version `docker/docker-compose.yml` pins. Checked that `docker/volumes/functions/main/index.ts` doesn't set `useReadSyncFileAPI` when it creates user workers. `pnpm build:guides-markdown` couldn't run in the sandbox: it needs GitHub credentials for federated content. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] The change is docs content only. ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1762](https://linear.app/supabase/issue/DOCS-1762/list-every-supported-sync-deno-api-and-say-they-apply-to-self-hosted). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
ada003c3d7 |
docs(auth): explain how the SSR session carries over between requests (#53975)
## Problem The "How it works" section of the SSR advanced guide says the tokens must be stored in cookies, but not that `@supabase/ssr` does this. A reader who signs a user in on one server route can't tell how a later request gets the session back, so they may pass tokens around and call `setSession` themselves. Related to [FDBKIN-20417](https://linear.app/supabase/issue/FDBKIN-20417/clarify-server-side-session-management-across-multiple-http-requests) Closes [DOCS-1765](https://linear.app/supabase/issue/DOCS-1765/explain-how-a-server-side-session-carries-over-to-the-next-request) ## Solution Two paragraphs in "How it works" on the SSR advanced guide explain the cookie round trip. On sign-in, a code exchange, a refresh, or a user update, the server client writes the session through `setAll`. On the next request, a new server client reads it back through `getAll`, with no `setSession` call. The framework setup stays on "Creating a Supabase client for SSR", which the new text links to. ## How to verify 1. Open `/docs/guides/auth/server-side/advanced-guide` on the preview and go to "How it works". 2. Check that the section says a server-side sign-in with `createServerClient` writes the session, access and refresh tokens included, to the `sb-<project_ref>-auth-token` cookie through `setAll`. 3. Check that it says a new server client on a later request restores the session through `getAll`, with no `setSession` call. 4. Click the "Creating a Supabase client for SSR" link and check that it opens that page. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and `pnpm exec oxfmt --check` on the changed file. Checked the facts against `@supabase/ssr` 0.12.7 (`createServerClient.js`, `cookies.js`, `utils/chunker.js`) and the cookie name on "Creating a Supabase client for SSR". Skipped the docs tests: they need Docker. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1765](https://linear.app/supabase/issue/DOCS-1765/explain-how-a-server-side-session-carries-over-to-the-next-request). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
3a9459fef2 |
docs: say which requests count toward the Management API rate limits (#53974)
## Problem The Management API rate limits section explains the limit, its scope, and its headers, but not which traffic it applies to. Readers can't tell whether CLI commands or calls to their own project, such as Edge Function invocations, count toward it. Related to [FDBKIN-22153](https://linear.app/supabase/issue/FDBKIN-22153/clarify-documentation-for-management-api-rate-limits-and-what-actions) Closes [DOCS-1764](https://linear.app/supabase/issue/DOCS-1764/say-which-requests-count-toward-the-management-api-rate-limit) ## Solution The "Rate limits" section of the Management API introduction now opens by saying that only requests to `https://api.supabase.com` count, and that requests to a project's own URL don't. The "Rate limit scope" subsection ends with a CLI example: `supabase functions deploy` sends at least one Management API request per function, so a large deploy to one project might reach the per-endpoint limit. The example sits after the scope rules so it reads as an application of them. The limits, tables, scope rules, and headers are unchanged. ## How to verify 1. Open `/docs/reference/api/introduction` in the preview and go to "Rate limits". 2. The intro says only requests to `https://api.supabase.com` count, and that requests to `https://<project-ref>.supabase.co`, such as Edge Function invocations and Data API calls, don't. 3. The end of "Rate limit scope" says the Supabase CLI uses the Management API, and that `supabase functions deploy` to one project with many functions might reach the per-endpoint limit. 4. The limit tables, scope list, and response headers match production. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'` (no errors), and `pnpm exec oxfmt --check` on the changed file. Checked the CLI claim against `supabase/cli` `apps/cli/src/shared/functions/deploy.ts`. By default it bundles with Docker and calls `POST /v1/projects/{ref}/functions` or `PATCH /v1/projects/{ref}/functions/{slug}` per function, then one bulk `PUT /v1/projects/{ref}/functions`. With `--use-api`, or when Docker isn't running, it calls `POST /v1/projects/{ref}/functions/deploy` per function. Because of that, the text doesn't name a single endpoint. The Edge Function invocation URL comes from the Edge Functions quickstart. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1764](https://linear.app/supabase/issue/DOCS-1764/say-which-requests-count-toward-the-management-api-rate-limit). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
101afae233 |
docs(auth): warn that users can change their own user metadata (#53973)
## Problem The "Adding and retrieving user metadata" section of the Managing user data guide shows how to set and read user metadata, but never says that users can change it themselves. A reader could store roles or tenant IDs there and trust them in RLS policies or app logic. Related to [FDBKIN-25396](https://linear.app/supabase/issue/FDBKIN-25396/document-that-raw-user-meta-data-is-client-mutable) Closes [DOCS-1763](https://linear.app/supabase/issue/DOCS-1763/warn-that-users-can-change-their-own-user-metadata-in-user-management) ## Solution Adds a danger admonition at the end of the section. It explains that any signed-in user can rewrite their own `user_metadata`, including the claim in the JWT, so it must not hold authorization data or be trusted in RLS. It points readers to `app_metadata` for values users must not change, which only a trusted server with the secret key can set. It links to the existing warnings on the Users page and in the RLS guide instead of repeating them. ## How to verify 1. Open `/docs/guides/auth/managing-user-data` on the preview and scroll to "Adding and retrieving user metadata". 2. Below the retrieval code tabs, a danger callout says that users can change their own user metadata and that it must not hold roles or tenant IDs or be trusted in RLS policies. 3. The callout says to store values that users must not change in `app_metadata`. 4. The links to the user object (`/docs/guides/auth/users#the-user-object`), `auth.jwt()` (`/docs/guides/database/postgres/row-level-security#authjwt`), the secret key page, and `auth.admin.updateUserById()` resolve and land on the right sections. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and `pnpm exec oxfmt --check` on the changed file; all pass. Docs tests skipped because they need Docker. Checked behavior against `supabase/auth` `internal/api/user.go` (`UserUpdate`: `data` updates user metadata with no admin check; `app_metadata` from a non-admin returns `not_admin`) and `internal/models/user.go` (`UpdateUserMetaData` merges keys and deletes null ones). ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] The change is scoped to one docs section and adds no code samples ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1763](https://linear.app/supabase/issue/DOCS-1763/warn-that-users-can-change-their-own-user-metadata-in-user-management). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
962ea89399 |
docs: show which roles can delete the production branch (#53972)
## Problem The project permissions table on the access control page lists Read and Write for the production branch, but not Delete. Readers can't tell whether a Developer can delete the production branch, though the table shows that one can delete development branches. Related to [FDBKIN-36106](https://linear.app/supabase/issue/FDBKIN-36106/clarify-docs-on-branch-deletion-behavior-with-rbac-for-different-user) Closes [DOCS-1760](https://linear.app/supabase/issue/DOCS-1760/show-which-roles-can-delete-the-production-branch-in-the-project) ## Solution The Branching rows on the Access Control page now have a Delete permission for the production branch. Only Owner and Administrator can use it. This matches the minimum role that the authorization model sets for deleting the production branch. The other rows and the footnotes stay the same. ## How to verify 1. Open `/docs/guides/platform/access-control#branching-permissions` on the preview. 2. Under Production Branch, a Delete row shows a check for Owner and Administrator and a cross for Developer and Read-Only. 3. The Development Branches rows (List, Create, Update, Delete) and the footnotes read as before. 4. The new row has the same columns and icons as the rows around it. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and `pnpm exec oxfmt --check` on the changed file. All passed. I checked the roles against `branching_production_delete: 'administrator'` in `apps/studio/components/interfaces/Account/AccessTokens/AccessToken.roles.ts` and against the delete-branch endpoint requirements in `packages/api-types/types/fga-requirements.ts`. I skipped the docs tests because they need Docker. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] The PR title follows the Conventional Commits format. - [x] The change is limited to the scope described above. ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1760](https://linear.app/supabase/issue/DOCS-1760/show-which-roles-can-delete-the-production-branch-in-the-project). Tedd doesn't read comments on this PR. Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
cce655195d |
docs(rls): explain how policy conditions let Postgres use partial indexes (#53970)
## Problem The "Add indexes" section of the Row Level Security guide covers plain and composite btree indexes, but not partial indexes. A reader whose policy filters on a fixed condition, such as a status flag, can't tell how to index it. Related to [FDBKIN-31278](https://linear.app/supabase/issue/FDBKIN-31278/clarify-coordination-between-rls-policies-and-partial-indexes-for) Closes [DOCS-1761](https://linear.app/supabase/issue/DOCS-1761/explain-how-rls-policy-predicates-let-postgres-use-partial-indexes) ## Solution "Add indexes" in the RLS guide now explains that Postgres applies a policy's condition like a `where` clause. A condition that doesn't depend on the user therefore lets queries use a partial index with the same predicate. Postgres matches only some equivalent forms, so the section tells readers to write the policy condition and the index predicate the same way. The example follows the section's existing pattern, a `test_table` policy followed by the index that serves it, and the section links to the partial indexes section of the indexes guide. ## How to verify 1. Open `/docs/guides/database/postgres/row-level-security#add-indexes` on the preview. 2. The section explains that a policy's fixed condition lets queries use a partial index with the same predicate, and that both should be written the same way. 3. The section has a `test_table` policy `using ( not is_archived )`, then a partial index `where not is_archived`, in the same style as the other examples in the section. 4. The section says a `using ( is_archived is false )` policy can't use that index. 5. The "partial index" link opens the Partial indexes section of the indexes guide. ## Checks I ran `pnpm turbo run typecheck`, `pnpm turbo run lint`, and `pnpm exec oxfmt --check` on the changed file. To test the snippets, I ran them in PGlite (Postgres 17) on a 200k-row `test_table`, then ran `explain` as `authenticated` on an `order by created_at desc limit 10` query. Policies `not is_archived` and `is_archived = false` both used the partial index. Policies `is_archived is false` and `using (true)` both used a sequential scan. Behavior checked against the Postgres docs for [partial indexes](https://www.postgresql.org/docs/current/indexes-partial.html) and [CREATE POLICY](https://www.postgresql.org/docs/current/sql-createpolicy.html). I skipped the docs tests because they need Docker. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] My change follows the docs style guide. - [x] I have checked that the links resolve. ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1761](https://linear.app/supabase/issue/DOCS-1761/explain-how-rls-policy-predicates-let-postgres-use-partial-indexes). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
76b8dfd2e5 |
chore: ssl enforcement doesn't restart db (#53860)
## Problem SSL enforcement currently warns that the database will be restarted. This is no longer the case. ## Solution SSL enforcement no longer restarts the database. Update references to indicate that only non-SSL enabled connections are disabled. Only display warning when enabling SSL enforcement. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
411e81bbd6 |
docs(csharp): update Client-Side Tracing guide for C# (#53928)
This PR updates the Client-Tracing Guide for C#, with the latest updates from the tracing initiative. |
||
|
|
bdc7f1a527 |
docs(auth): add RLS policies for the profiles table in User Management (#53770)
## Problem The "Accessing user data via API" section of the User Management guide creates `public.profiles`, enables RLS, and adds a signup trigger, but shows no policy. A reader who copies it gets a table that no client can read. The section also never says that the trigger creates the profile row, so readers try to insert it from the client after `signUp`, and that insert fails under RLS. Related to [FDBKIN-20750](https://linear.app/supabase/issue/FDBKIN-20750/improve-guidance-on-creating-public-user-profile-tables-linked-to-auth) Closes [DOCS-1728](https://linear.app/supabase/issue/DOCS-1728) ## Solution The section now says that the trigger creates the profile row at signup, and why it needs no insert policy: the `security definer` function runs as `postgres`, which bypasses RLS. It explains that a client insert fails without an insert policy, and that with no policies clients can't read the table. Then it adds a select policy and an update policy that let each signed-in user read and edit only their own row, keyed on this page's `id` column. Other patterns link to the Row Level Security guide instead of being repeated. The sentence that introduced the trigger said it "updates" the table. It now says it creates a row. ## Checks Ran Prettier on the changed file, plus `pnpm turbo run lint --filter='[origin/master]'` and `pnpm turbo run typecheck --filter='...[origin/master]'`, which passed. I ran the section's SQL blocks in order as one script on PGlite (Postgres 17), with stub `anon`/`authenticated`/`service_role` roles, an `auth.users` table, and an `auth.uid()` that reads `request.jwt.claim.sub`. Results: - The trigger created profile rows with no insert policy. - As `authenticated`, a user read only their own row and updated only their own row. Changing `id` to another user's, or inserting from the client, failed with `new row violates row-level security policy for table "profiles"`. - `anon` read no rows. Facts were checked against the RLS guide's select and update policy sections and the functions guide's `security definer` section. ## Second reader Verdict: ready, no blockers. Nits: - The trigger's intro sentence repeated the new text and said "update". Fixed: the intro now says it creates a row, and the paragraph after the caution now opens with what not to do. - The insert explanation was split around the policies. Fixed: it's now one paragraph. - It didn't say why `security definer` skips the insert policy. Fixed: the page now names the `postgres` owner, which bypasses RLS. - Link the public-profiles example directly. Fixed. - Spell out RLS on first use. Left as is: the abbreviation predates this change, and the page links Row Level Security by name above. Second read of the reworded insert paragraph: ready, no blockers. Two of its nits are fixed: the page says the owner is `postgres` when the function is created in the Dashboard or by a migration, and it uses "sign-up" instead of the JavaScript method name. Two were left for review: split the "creates it" and "no insert policy" clauses, and write "Row Level Security (RLS)". A third read of that fix found no blockers and no nits. Follow-ups outside this change: - The grants block gives `anon` select and `authenticated` insert/delete, which no policy uses. - The quickstart SQL partial still adds a client insert policy for profiles. ## How to verify 1. Open `/docs/guides/auth/managing-user-data` on the preview, section "Accessing user data via API". 2. The section shows SQL for a select policy and an update policy on `public.profiles` that use `auth.uid()` and the `id` column. 3. The text says that the trigger creates the profile row at signup and that the client doesn't insert it. 4. The text says that without policies, clients can't read or change the table. 5. The section links to the Row Level Security guide for other policy patterns. 6. Pasting the section's SQL blocks, in order, into the SQL Editor runs without errors. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
4e15414929 |
docs(guides): rework five more explainer pages to the explainer template (#53757)
## Problem Five more concept pages are close to the explainer template from #53751. They have short or missing descriptions, generic or question headings, a pointer-only heading, and no Related resources. Several also have filler, marketing language, or time phrases. Closes DOCS-1617. This is a second batch on top of #53755. ## Solution The PR is one squashed commit. It covers a style pass, the restructure to the template, critic-pass fixes, tables and lists, the opener change, content moved in from other pages, and two headings renamed to `X vs Y`. ### Structure | Page | Change | | --- | --- | | `ai/keyword-search` | Value statement, `Using full-text search` (a pointer-only heading) and `See also` folded into Related resources | | `ai/vector-indexes` | Value statement, a `## Limits` section for the dimension limits and version check, `Resources` to Related resources | | `storage/buckets/fundamentals` | Retitled `Storage buckets`, value statement, an access model table, the bucket types promoted to H2, `Example use cases` headings to lead-in sentences, Related resources | | `storage/analytics/introduction` | Retitled `Analytics buckets`, value statement, question and generic headings made descriptive, Related resources | | `realtime/architecture` | Retitled `Realtime architecture`, value statement, `Elixir & Phoenix` to `Elixir and Phoenix`, Related resources | - **Linked headings**: headings that other pages link to keep their text: `#distance-operators`, `#public-buckets`, `#private-buckets`, and `#access-model`. Moving a bucket type from H3 to H2 keeps its slug. - **Openers and tables**: only the value statement and a cross-reference come before the first heading, and each concept opener moves into the first H2, per the template change in #53751. Prose comparisons and parallel facts become tables and lists. On Realtime architecture, the WAL streaming steps are a numbered list. - **Moved content**: each explainer now owns its concept, and the page that held it links back. Nothing is newly written; every added fact comes from an existing page: - Keyword search: `## How keyword search works`, summarized from the Usage section of [Full text search](/docs/guides/database/full-text-search#usage), which links back. - Vector indexes: `## Trade-offs` and `## When to use each index type`, from [HNSW indexes](/docs/guides/ai/vector-indexes/hnsw-indexes) and [IVFFlat indexes](/docs/guides/ai/vector-indexes/ivf-indexes). Both now link back, and their copies of the index list and dimension limits are replaced with links. - Analytics buckets: `## Services`, moved from the Architecture overview in [Iceberg Catalog](/docs/guides/storage/analytics/connecting-to-analytics-bucket), and `## Limits`, from [Create an analytics bucket](/docs/guides/storage/analytics/creating-analytics-buckets) and [Analytics buckets limits](/docs/guides/storage/analytics/limits). - **Facts**: unchanged. The value statements, the access model table, and Related resources are the only new text, and the table summarizes facts already on the page. ### Style - **Descriptions**: add or rewrite one per page, 150 to 160 characters. - **Alt text**: rewrite the Realtime diagram's alt text against the image. It was `Architecture`. - **Terms**: `WORD_LIST.md` passes for numbers, _will_, _since_, _allows you to_, _performant_, _here_ as link text, filler, and marketing language such as "perfect for" and "an amazing Supabase user". - **Critic pass**: shorter sentences, repeated points and idioms cut, fewer repeated links, lowercase SQL, code-formatted type names, and external links that name their destination. ### Structure numbers These numbers are from before the opener and table changes. | Page | Chars before → after | Headings | Generic headings | Description chars | | --- | --- | --- | --- | --- | | `ai/keyword-search` | 2,611 → 2,544 | 3 → 2 | 1 → 0 | 40 → 156 | | `ai/vector-indexes` | 2,557 → 2,890 | 3 → 4 | 1 → 0 | 28 → 153 | | `storage/buckets/fundamentals` | 2,128 → 3,189 | 5 → 4 | 2 → 0 | 41 → 156 | | `storage/analytics/introduction` | 1,698 → 2,332 | 2 → 3 | 0 → 0 | 0 → 158 | | `realtime/architecture` | 4,474 → 5,185 | 6 → 7 | 0 → 0 | 45 → 153 | ### How the template did - **New learnings, added to #53751**: an optional `## When to use <concept>` section, because the template's own reader question asks "when do I use it?". One H2 per Process stage, for `realtime/architecture`. More than one Parts section, because `ai/vector-indexes` has index types and distance operators. - **Fit well**: `storage/buckets/fundamentals` is a parts table followed by one H2 per part, which is the rule from the first batch. - **Still loose**: `realtime/architecture` maps to the template only as a run of Process stages. A future rework could group them, or split `Broadcast from Postgres` into its own page. `storage/analytics/introduction` keeps a descriptive comparison heading instead of `## Trade-offs`. Skipped on purpose: the Realtime PNG diagram isn't converted to Mermaid, because that's new content. ### Preview | Page | Live | Preview | | --- | --- | --- | | Keyword search | [Live](https://supabase.com/docs/guides/ai/keyword-search) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/ai/keyword-search) | | Vector indexes | [Live](https://supabase.com/docs/guides/ai/vector-indexes) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/ai/vector-indexes) | | Storage buckets | [Live](https://supabase.com/docs/guides/storage/buckets/fundamentals) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/storage/buckets/fundamentals) | | Analytics buckets | [Live](https://supabase.com/docs/guides/storage/analytics/introduction) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/storage/analytics/introduction) | | Realtime architecture | [Live](https://supabase.com/docs/guides/realtime/architecture) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/realtime/architecture) | ## Review instructions 1. Open each page's live and preview links from the Preview table side by side. 2. Check that each page opens with a value statement and ends with Related resources. 3. Open `/docs/guides/ai/vector-indexes#distance-operators` and `/docs/guides/storage/buckets/fundamentals#public-buckets` on the preview, and check that each jumps to its heading. 4. On Storage buckets, check that the access model table matches the Private buckets and Public buckets sections. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
b2f53d70cb |
fix(docs): use owner_id in the storage delete policy example (#53834)
## Problem Fixes #53833. The Delete Objects guide shows a delete policy that compares the deprecated `storage.objects.owner` column (`uuid`) with `auth.uid()::text` (`text`). The policy fails to create: ``` ERROR: operator does not exist: uuid = text ``` `owner` is deprecated, and `owner_id` is the `text` column that stores the `sub` claim. This is the only Storage guide that still uses `owner`. ## Solution Compare `owner_id` with the `sub` claim read as text: ```sql owner_id = (select auth.jwt()->>'sub') ``` `auth.uid()` casts `sub` to `uuid`, so it errors for non-UUID subjects from third-party auth. Reading the claim as text covers both. This also matches the Storage access control guide. This changes one line in one `.mdx` file. ## Verification Tested against `supabase/postgres:17.6.1.143` with the `storage.objects` column types from the Storage migrations (`owner uuid`, `owner_id text`) and the real `auth.jwt()` definition. Before: ``` using ( owner = (select auth.uid()::text) ); ERROR: operator does not exist: uuid = text ``` With `owner_id` and `auth.uid()` the policy creates, but a non-UUID subject fails at delete time with `invalid input syntax for type uuid: "clerk_user_123"`. After: ``` using ( owner_id = (select auth.jwt()->>'sub') ); CREATE POLICY ``` With a non-UUID subject (`clerk_user_123`) and with a UUID subject, deleting as `authenticated` removed only the matching user's row. Prettier passes on the file. ## Review instructions 1. Open `apps/docs/content/guides/storage/management/delete-objects.mdx`. 2. Confirm the RLS example uses `owner_id` and reads `sub` with `auth.jwt()`. 3. Run the policy against a project or local database. It should create and restrict deletes to the owner. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) I used AI to help debug and verify this, but I reviewed the change and am submitting the PR myself. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
b66bedd1c9 |
docs(guides): rework five explainer pages to the explainer template (#53755)
## Problem Five concept pages are close to the explainer template from #53751 but don't follow it. They have no value statement and no Related resources, and they have style gaps such as missing descriptions, topic-name alt text, and a diagram with no accessibility title or description. Part of DOCS-1617. A second batch of five pages is in #53757. ## Solution The PR is one squashed commit. It covers a style pass, the restructure to the template, critic-pass fixes, tables and lists, the opener change, and content moved in from other pages. ### Structure | Page | Change | | --- | --- | | `auth/architecture` | Value statement, a `## Layers` table from the numbered list, Related resources | | `storage/cdn/fundamentals` | Value statement, `## Example` renamed to `## How caching works`, Related resources | | `storage/schema/design` | Retitled `Storage schema`, value statement, `## Tables` heading, the tables paragraph as a table, Related resources | | `storage/security/ownership` | Retitled `Storage ownership` with the sidebar label `Ownership`, value statement, the deprecated `owner` note moved into body text, Related resources | | `auth/identities` | Retitled `Auth identities`, value statement, Related resources | - **Linked headings**: headings that other pages link to keep their text: `#client-layer`, `#auth-service`, `#postgres`, `#public-vs-private-buckets`, and `#the-user-identity-object`. - **Openers and tables**: only the value statement and a cross-reference come before the first heading, and each concept opener moves into the first H2, per the template change in #53751. Prose comparisons and parallel facts become tables and lists. On Storage CDN, the cache steps are a numbered list, and a library analogy follows them. - **Moved content**: each explainer now owns its concept, and the how-to that held it links back. Nothing is newly written; every added fact comes from an existing page: - Identities: `## How Auth links identities` and `## Limits`, moved from the Automatic linking section and SAML note in [Identity linking](/docs/guides/auth/auth-identity-linking), which now links back. - Storage ownership: who owns a copied or moved object, from [Copy objects](/docs/guides/storage/management/copy-move-objects), which links back. - Auth architecture: `## Limits`, the Auth server's single region, from [JWTs](/docs/guides/auth/jwts#verifying-a-jwt-from-supabase), which now keeps only its advice and links back. - Storage CDN: the extra statuses that count as hits, from [Cache metrics](/docs/guides/storage/cdn/metrics), which links back. - **Facts**: unchanged. The value statements, Related resources, and the CDN analogy are the only new text. Tables, lists, and moved content restate facts already in the docs. ### Style - **Descriptions**: add or rewrite one per page, 150 to 160 characters. - **Alt text**: rewrite against the images. The Auth architecture diagram now names each route and service, and the two CDN images describe the cache miss and cache hit. - **Diagram**: add `accTitle` and `accDescr` to the Storage schema diagram. - **Admonitions**: lead with their impact, and cut one that restated the body text on Auth architecture. - **Terms**: `WORD_LIST.md` passes for _we_, _will_, _since_, _auto-_, _ID_, numbers, and spelled-out RLS. External links name their destination. - **Subtitles**: cut two that repeated the title or description. The critic-pass fixes come from a clean-context critic pass against the style guide. Facts are unchanged. Skipped on purpose: - The CDN page's two PNG sequence diagrams aren't converted to Mermaid, because that's new content. - `Public vs private buckets` keeps `vs`, because other pages link to that heading. ### Structure numbers These numbers are from before the opener and table changes. | Page | Chars before → after | Headings | Generic headings | Description chars | | --- | --- | --- | --- | --- | | `auth/architecture` | 3,437 → 4,839 | 3 → 5 | 0 → 0 | 0 → 159 | | `storage/cdn/fundamentals` | 2,617 → 3,632 | 2 → 3 | 1 → 0 | 53 → 152 | | `storage/schema/design` | 2,819 → 3,875 | 1 → 3 | 0 → 0 | 30 → 154 | | `storage/security/ownership` | 1,628 → 2,006 | 1 → 2 | 0 → 0 | 71 → 155 | | `auth/identities` | 3,315 → 4,087 | 1 → 2 | 0 → 0 | 0 → 159 | Characters grow mostly from descriptions, longer alt text, table padding, and Related resources. Search top-k isn't recorded, because there's no fixed query set yet. ### How the template did - **Fit without changes**: the value statement with a how-to link, Related resources, the `How <concept> works` Process slot, and the diagram accessibility rule. The rule caught a real gap on Storage schema. - **Fit after a fix in #53751**: the concept heading, one H2 per part, linked headings in a slot, principles, and the repeated how-to link. See the learnings in #53751. - **Still loose**: `auth/architecture` has no concept paragraph of its own, because the layers are the concept. `storage/security/ownership` has an `## Access control` section that fits no slot, which is a principle plus one SQL example. ### Preview | Page | Live | Preview | | --- | --- | --- | | Auth architecture | [Live](https://supabase.com/docs/guides/auth/architecture) | [Preview](https://docs-git-docs-explainer-rework-supabase.vercel.app/docs/guides/auth/architecture) | | Storage CDN | [Live](https://supabase.com/docs/guides/storage/cdn/fundamentals) | [Preview](https://docs-git-docs-explainer-rework-supabase.vercel.app/docs/guides/storage/cdn/fundamentals) | | Storage schema | [Live](https://supabase.com/docs/guides/storage/schema/design) | [Preview](https://docs-git-docs-explainer-rework-supabase.vercel.app/docs/guides/storage/schema/design) | | Storage ownership | [Live](https://supabase.com/docs/guides/storage/security/ownership) | [Preview](https://docs-git-docs-explainer-rework-supabase.vercel.app/docs/guides/storage/security/ownership) | | Identities | [Live](https://supabase.com/docs/guides/auth/identities) | [Preview](https://docs-git-docs-explainer-rework-supabase.vercel.app/docs/guides/auth/identities) | ## Review instructions 1. Open each page's live and preview links from the Preview table side by side. 2. Check that each page opens with a value statement and ends with Related resources. 3. Open `/docs/guides/auth/architecture#client-layer` and `/docs/guides/storage/cdn/fundamentals#public-vs-private-buckets` on the preview, and check that each jumps to its heading. 4. On Auth architecture and Storage CDN, compare the new alt text with the images in `apps/docs/public/img`. 5. On Storage schema, check that the diagram renders and that the tables table matches it. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
8222420a8e |
docs: fix backup link in project deletion guide (#53871)
## Problem The point-in-time recovery link is relative to the deletion guide, which sends readers to a nested `/docs/guides/platform/docs/guides/platform/backups` URL and returns 404. ## Solution Add the leading slash so it points to `/docs/guides/platform/backups#point-in-time-recovery`, consistent with the automated-backups link beside it. ## Review instructions 1. Open the link in the changed page and confirm it reaches the intended destination. Verified the old URL returns 404, the corrected page returns 200, and the anchor is present. Prettier, MDX/GFM parsing, and `git diff --check` pass. `pnpm build:guides-markdown` is blocked by missing GitHub credentials for federated content; running the generator directly also stops at the unavailable generated `ai-skills.json`. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: linzch3 <20380442+linzch3@users.noreply.github.com> Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
81e0a08675 |
docs: fix dead supabase-kt link in GitHub sign-in guide (#53816)
## Problem The Kotlin tab of the GitHub sign-in guide links to `Github` in `Providers.kt` at a path that returns 404 (the repo is now `supabase/supabase-kt` and the package folder is `io/supabase`). ## Solution Point the link to the current file. Lines L16-L20 still contain `data object Github`. Opened the new URL; it loads. Prepared with Claude Code; I reviewed the change. Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
8e50db7952 |
docs: link the SQL to REST API Translator from the joins guide (#53771)
## Problem Readers who know the SQL join they want have to work out the matching embedding syntax by hand. The joins and nesting guide never mentions the SQL to REST API Translator, which does that conversion, so readers don't find it. Related to [FDBKIN-7994](https://linear.app/supabase/issue/FDBKIN-7994/improve-documentation-and-tooling-for-postgrest-join-syntax) Closes [DOCS-1729](https://linear.app/supabase/issue/DOCS-1729) ## Solution In the "Join types and join modifiers" section of `/guides/database/joins-and-nesting`, a new paragraph in the section's intro points readers who think in SQL to the translator. The paragraph says that the translator turns a SQL `select` query into a Data API request and Supabase JavaScript client code, with SQL joins as embedded relations. It also says that not every query translates, and names the translator's join limits: it handles only left and inner joins that compare columns with `=`, and the request it returns works only when a foreign key links the two tables. The paragraph follows the intro's explanation of left joins and `!inner`, so the translator's left-and-inner limit builds on it, and readers see the shortcut before the syntax table and the example tabs. Existing text is unchanged. ## How to verify 1. On the docs preview, open `/docs/guides/database/joins-and-nesting` and go to "Join types and join modifiers". 2. After the paragraph that ends "use `!inner` on the embedded relation", a paragraph names the SQL to REST API Translator and says that it converts SQL joins into embedded relations and client code. 3. The link opens `/docs/guides/api/sql-to-rest`. 4. The paragraph says that some queries won't translate. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed file. All pass. Skipped the docs tests, because they need Docker. Checked the facts against `apps/docs/content/guides/api/sql-to-rest.mdx` (the subset note), the translator component in `packages/ui-patterns/src/SqlToRest/` (cURL, HTTP, and JavaScript outputs), and the join handling in `@supabase/sql-to-rest` 0.1.6: it throws on join types other than inner and left and on join conditions other than `=`, and it does not check for a foreign key. ## Second reader First read: ready, no blockers, three nits. All three applied: the paragraph moved after the syntax table, two sentences merged, and the join limits named. Second read: one blocker. The join-limit sentence had the Data API as its subject, but the foreign key limit belongs to the translator, and the Data API also supports computed relationships. Fixed by making the translator the subject. Third read, after the first sentence was split in two: one blocker. The translator doesn't check foreign keys, so a join without one still translates, and the request then fails. Fixed: the sentence now says the translator handles only left and inner joins that compare columns with `=`, and that the request works only when a foreign key links the two tables. Nits left as they are: the translator outputs joins as flattened spread embeddings (`...relation(...)`), which this page doesn't explain; "client code" could read "supabase-js code". Fourth read, after the join-limits sentence was split in two: ready, no blockers. Nit left as it is: "For example" introduces translator limits after a sentence about Data API limits. Fifth read, after the paragraph moved into the section intro: ready, no blockers, and the placement matches the section's topic. Nits left as they are: when two foreign keys link the same tables, the translator's request is ambiguous and fails, because it never adds a foreign key hint (ambiguous foreign keys are out of scope here); and the last two sentences could form their own paragraph. Left as follow-ups outside the scope: the page intro says "data APIs" in lowercase, `guides/api/sql-to-api.mdx` doesn't link to the translator, and "We can get…" on the page uses _we_ for the reader. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
0af0e9aed4 |
docs(storage): explain which operations need policies on storage.buckets (#53769)
## Problem The Storage access control guide only mentions policies on `storage.objects`. A reader securing a private bucket can't tell whether those policies are enough or whether `storage.buckets` needs its own policies, and the private-bucket read pattern is hard to find among examples that look like public-bucket examples. Related to [FDBKIN-5913](https://linear.app/supabase/issue/FDBKIN-5913/clarify-documentation-for-securing-private-storage-buckets-with-rls) Closes [DOCS-1727](https://linear.app/supabase/issue/DOCS-1727/explain-which-storage-operations-need-policies-on-storagebuckets) ## Solution The "Access policies" section of `/guides/storage/security/access-control` now states that policies on `storage.objects` control every file operation in both private and public buckets, and names the two cases where Storage skips the check: public URLs of public buckets, and signed URLs. A short table lists the bucket operations that need policies on `storage.buckets`, with the permissions each needs on both tables. The section also points to the existing per-user `SELECT` example as the pattern for private-bucket reads. Existing text and the API reference link stay as they were. Checks: Prettier on the changed file, and `pnpm turbo run lint --filter='[origin/master]'` (0 errors). Facts were checked against the per-method RLS notes in `apps/docs/spec/supabase_py_v2.yml` and `supabase_kt_v1.yml`, and against `supabase/storage`, where object routes look up the bucket as superuser (`src/http/routes/object/getObject.ts`, `src/storage/object.ts`, `src/storage/uploader.ts`), and public and signed-URL downloads bypass RLS (`getPublicObject.ts`, `getSignedObject.ts`, `uploadSignedObject.ts`). The docs tests need Docker, so they did not run. How to verify on the preview, at `/docs/guides/storage/security/access-control`: 1. "Access policies" says `storage.objects` policies control every file operation in private and public buckets, and that file operations need no policy on `storage.buckets`. 2. A table lists create, retrieve, list, update, delete, and empty a bucket, with the permissions on `storage.buckets` and `storage.objects` for each. 3. The "Policy examples" link goes to the section with the "Individual user Access" policy, and the "public bucket" link goes to the Access model section of Buckets fundamentals. 4. The admonition link to the API reference still opens the createBucket reference. ## Second reader Verdict: ready, no blockers. - Fixed: the "Empty a bucket" row was incomplete without the sentence after the table, so the table now has a `storage.objects` column. - Fixed: the vague "manage buckets" now reads "call bucket methods". - Fixed: the exceptions are a separate paragraph, reworded so that Storage, not the policies, does the checking. - Fixed: the public-bucket exception now links to Buckets fundamentals. - Left: moving the API reference admonition next to the table. The brief keeps existing text in place. - Left: linking each table row to its reference page. The table stays short, and the existing admonition links to the reference. - Left as follow-ups outside this change: the frontmatter `description` and `sidebar_label` mention only uploads, the "here" link text, stray spaces before periods, "incredibly powerful", "easy", and missing periods in two admonitions. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
698bb077cf |
docs(storage): list signed URLs in the Storage overview's key features (#53766)
## Problem The Key features list on the Storage overview didn't mention signed URLs. A reader who scans it to see what Storage can do finds no way to share files from private buckets, so they could conclude that Storage can't do it. Related to [FDBKIN-26964](https://linear.app/supabase/issue/FDBKIN-26964/improve-documentation-and-discovery-for-storage-signed-urls) Closes [DOCS-1724](https://linear.app/supabase/issue/DOCS-1724) ## Solution The Storage overview (`/guides/storage`) now lists signed URLs as a key feature. The new item says that files in private buckets can be shared with time-limited signed URLs, without making the buckets public, and links to the Signing URLs section of the Serving assets page. It sits next to Fine-grained Access Control and uses the same format as the other items. The other items are unchanged. ## Checks I ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed file. All passed. I skipped the docs tests because they need Docker. I checked the claims against the `### Signing URLs` section of `serving/downloads.mdx` (`createSignedUrl(path, expiresIn)`, anchor `#signing-urls`) and against `createSignedUrl` and `createSignedUrls` in `apps/docs/spec/supabase_js_v2.yml`. ## Second reader Verdict: ready. No blockers. - Nit: "private buckets … the bucket" mixed plural and singular. Fixed: it now says "the buckets". - Nit, optional: the bold label and the link text both say "signed URLs". I kept it, because other items in the list repeat their label the same way. - Outside the scope of this PR, left as is: marketing words ("robust", "lightning-fast") and missing hyphens ("Multi Protocol", "S3 compatible") in the existing overview text, and an inconsistent "Private buckets" list on the Serving assets page. ## How to verify 1. On the preview, open `/docs/guides/storage`. The Key features list has a **Signed URLs** item that says files in private buckets can be shared with time-limited signed URLs, without making the buckets public. 2. Click the link in that item. It opens `/docs/guides/storage/serving/downloads#signing-urls` and lands on the Signing URLs heading. 3. The other Key features items read the same as on production. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
a30c99d09d |
docs(platform): say that PrivateLink doesn't carry Data API or client library traffic (#53767)
## Problem The PrivateLink page said PrivateLink doesn't support "API, Storage, Auth, or Realtime". Readers couldn't tell that "API" meant the Data API, so they couldn't tell whether requests from `supabase-js` and the other client libraries go over the private connection. Related to [FDBKIN-15262](https://linear.app/supabase/issue/FDBKIN-15262/clarify-in-docs-what-traffic-is-routed-through-privatelink) Closes [DOCS-1725](https://linear.app/supabase/issue/DOCS-1725) ## Solution The PrivateLink page now names the Data API (REST and GraphQL) and links to its guide. It also says that the client libraries call the project URL over the public internet, not PrivateLink. A backend whose database traffic must stay private should connect to Postgres directly or through the dedicated pooler. "How PrivateLink works" and the "Service Scope" limitation now say the same thing. Only that existing text changed, and the page has no new section. ## How to verify On the preview, open `/docs/guides/platform/privatelink`: 1. "How PrivateLink works" says PrivateLink carries only Postgres connections on ports `5432` and `6543`. It also says the client libraries call the Data API, Auth, Storage, and Realtime at `https://<project_ref>.supabase.co` over the public internet. 2. The same section says what to do when a backend's database traffic must stay private. 3. The "Service Scope" bullet under "Limitations" says the same thing. 4. Both "Data API" links open `/docs/guides/api`. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed file. All passed. I skipped the `docs` tests because they need Docker. I checked the facts against the page's own setup steps (the endpoint is a database host on ports `5432` and `6543`), the Studio PrivateLink form (each connection targets a database), and `guides/api.mdx`, which gives the Data API URL as `https://<project_ref>.supabase.co/rest/v1/`. ## Second reader Verdict: ready, no blockers. I fixed these nits: - The project URL was stated twice in a row. I merged the two sentences. - The new host clause covered the PrivateLink endpoint option but not the VPC Lattice service network option. I dropped it, because the setup steps already cover hostnames. - "If your backend's traffic must stay private" promised too much, because Auth, Storage, and Realtime can't go private. It now says "database traffic". - I made the run-on sentence in the "Service Scope" bullet easier to read. These are left as they were: - The reader suggested `/docs/guides/database/connecting-to-postgres#data-apis-and-client-libraries` as the link target. I kept `/docs/guides/api`, the Data API's own guide. - These problems are on the page but outside this change: "organisation level" spelling, "e.g.", the missing period on "Feature Evolution", a note written as a numbered step, and Edge Functions missing from the list of public services. Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
78870669cd |
docs: say where to create the env file in the Vite quickstarts (#53768)
## Problem The React, Vue, SolidJS and Refine quickstarts tell the reader to create an env file but not where. The next step creates `src/lib`, so a reader can put the file in `src/`. Vite loads env files only from the project root by default, so `import.meta.env.VITE_SUPABASE_URL` then comes back `undefined`. Related to [FDBKIN-25261](https://linear.app/supabase/issue/FDBKIN-25261/clarify-env-file-placement-in-the-react-quickstart-guide) Closes [DOCS-1726](https://linear.app/supabase/issue/DOCS-1726/say-where-to-create-the-env-file-in-the-vite-based-quickstarts) ## Solution The env step of each of these four quickstarts now says to create the file in the root of the project, next to `package.json`. It reuses the "in the root of your project" wording that the TanStack and Expo quickstarts already use, and `package.json` gives the reader a concrete landmark that rules out `src/`. Only that one sentence changes on each page. ## How to verify On the docs preview: 1. `/docs/guides/getting-started/quickstarts/reactjs`, step 6: the first sentence says to create `.env.local` in the root of your project, next to `package.json`. 2. `/docs/guides/getting-started/quickstarts/vue`, step 6: same for `.env.local`. 3. `/docs/guides/getting-started/quickstarts/solidjs`, step 6: same for `.env.local`. 4. `/docs/guides/getting-started/quickstarts/refine`, step 5: same for `.env`. 5. No other text on these pages changes. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'` (0 errors), and Prettier on the four changed files; all pass. Checked against Vite's `envDir` option (defaults to the project root) and confirmed each page scaffolds a Vite app. Skipped the docs unit tests: they need Docker. ## Second reader Verdict: ready, no blockers. One nit: "project" could be read as the Supabase project, since the same sentence mentions the project Connect panel. Kept the wording, because "next to `package.json`" settles it and it matches the sibling quickstarts. Pre-existing issues it noted outside this change: "populate with" missing "it" on the Vue and SolidJS pages, missing end punctuation on the React sentence, and the same missing location in several framework tutorials and the Astro and Nuxt quickstarts. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
77011f0ed6 |
docs: enable pgvector in the extensions schema in the Next.js vector search guide (#53772)
## Problem The Next.js vector search guide enables pgvector with `with schema public`, but the later SQL declares columns and function parameters as `extensions.vector(1536)`. A reader who copies the guide's SQL into one migration gets `ERROR: type "extensions.vector" does not exist` at the `nods_page_section` table, so `supabase start` fails. Related to [FDBKIN-11272](https://linear.app/supabase/issue/FDBKIN-11272/fix-outdated-langchain-sql-guide-using-non-existent-extensionsvector) Closes [DOCS-1730](https://linear.app/supabase/issue/DOCS-1730/enable-pgvector-in-the-extensions-schema-in-the-nextjs-vector-search) ## Solution The "Enable the pgvector extension" step now installs pgvector in the `extensions` schema, so the `vector` type is where the rest of the guide's SQL expects it. This also avoids the Security Advisor's extension-in-public lint and matches the other pgvector pages, which already use `with schema extensions`. The `extensions.vector` references stay as they are. How to verify on the preview: 1. On `/docs/guides/ai/examples/nextjs-vector-search`, the "Enable the pgvector extension" step shows `create extension if not exists vector with schema extensions;`. 2. Copying every SQL block of the guide, in order, into one migration runs without `type "extensions.vector" does not exist`. ## Checks Ran the page's three SQL blocks in document order in PGlite with pgvector, after creating an `extensions` schema, an `anon` role, and a `"$user", public, extensions` search path. Before the change they fail with `type "extensions.vector" does not exist`. After it they all run, pgvector sits in `extensions`, and `match_page_sections` returns an inserted 1536-dimension row. Also ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'` (warnings only, none from this page), and Prettier on the changed file. Skipped the `docs` package tests: they need Docker. ## Second reader Verdict: ready. No blockers, no nits. Noted outside this change, left as follow-ups: - The page's Dashboard tab runs Studio's OpenAI Vector Search quickstart, which still installs pgvector in `public`, so the two tabs now use different schemas. The fix for that belongs in the Studio snippet. - Two steps of the SQL tab are both numbered `step={3}`. - Line 12 says "Store you embeddings". - The page uses "we/our" in places, against the style guide's voice. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
50d2f79b2a |
docs(auth): edit the Email Templates page and note that confirmations must be on (#53774)
Part of DOCS-1634
## Problem
The Email Templates page never says the confirmation email is sent only
when email confirmations are on. A reader who customizes the template
with confirmations off never sees it sent. The rest of the page also had
loose wording, the Management API example sat under the local
development section, and two variable descriptions were wrong.
## Solution
One commit per change type:
1. **Addition:** a paragraph stating that confirmations must be on,
where to turn them on in hosted and local projects, and what happens
when they are off. Checked against `spec/cli_v1_config.yaml`
(`auth.email.enable_confirmations`, default `false`) and the testing
guide.
2. **Style:** active voice, word list terms (`sign-up`, `for example`),
and the email prefetching workarounds rewritten as two numbered
procedures. No moves.
3. **Structure:** moves only, plus one link-text update.
- Move the Management API example under **Hosted projects**.
- Move **Customization** above **Limitations**, and **Mobile deep
linking** to the end.
- Rename **Terminology** to **Template variables**, and the title to
sentence case. The heading keeps the `#terminology` anchor, which the
`review-the-docs` skill links to.
4. **Technical:** fix `{{. ConfirmationURL }}` to `{{ .ConfirmationURL
}}` in the `{{ .Token }}` row, and "old phone address" to "old phone
number" in the `{{ .OldPhone }}` row.
The sidebar label in `NavigationMenu.constants.ts` stays "Email
Templates".
## Review instructions
1. Review the PR commit by commit.
2. Open `/docs/guides/auth/auth-email-templates` on the preview.
3. Check the confirmations paragraph appears after the security
notifications sentence, and its links resolve.
4. Check the Management API example is under **Hosted projects**.
## Checklist
Check all before review:
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
|
||
|
|
0ee83da5e5 | chore(self-hosted): update 2026-11-23 - 0.8.5 (#53866) | ||
|
|
ca8ee0b93e |
docs(auth): document dedicated scope for SAML providers (#53859)
## What Documents the SAML \`dedicated_scope\` option added in [supabase/auth#2893](https://github.com/supabase/auth/pull/2893) and exposed in the CLI in [supabase/cli#7665](https://github.com/supabase/cli/pull/7665). Some identity providers, notably Microsoft Entra, don't allow the same entity ID in more than one application, so a project could connect only one such app. A provider with a dedicated scope gets its own entity ID, metadata URL, and ACS URL scoped to its provider ID. ## Changes - `auth-sso-saml.mdx`: new "Use a dedicated scope for a connection" section with the URL comparison, the `--dedicated-scope` flag, which commands print the dedicated URLs, and a setup procedure for identity providers (such as Okta) that need the URLs when the app is created. The shared-URL table now links to it. - `cli_v1_commands.yaml`: adds `--dedicated-scope` to `supabase sso add`. ## Needs review - The Entra-specific flow isn't verified. The procedure follows the Okta workflow generically; it's unclear whether Entra rejects a second app created with the shared entity ID. - "Remove and add the connection again" to change scope is inferred, because `sso update` doesn't accept the flag. - No minimum CLI or Auth version is stated. - The generated Management API reference isn't updated, since the published spec doesn't document `dedicated_scope` yet. - The self-hosted SAML page isn't checked. - Not run: docs build, link and anchor checks, `test-the-docs`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
b103d6098b |
docs(platform): post-restore reconfiguration partial for migration and clone guides (#53782)
Move the list of items that a restore doesn't carry over into a single `restore-manual-configurations` partial, rendered as a caution admonition, and include it on the clone, backup-restore, and dashboard-restore pages. - Add the partial with links for transferring Storage objects and Edge Functions. - Replace the inline lists in clone-project and dashboard-restore. - Move compute size, disk, SSL, and network restrictions into the "What will be transferred?" list on the clone page. ## Problem - Inconsistent usage of steps that require reconfiguration after migration/cloning ## Solution - Consolidate to a partial and add it to one migration guide that didn't have instructions previously ## Review instructions - Doc only contents so should be sufficient to review from source - Notable changes - Previously [Backup and Restore using the CLI](https://supabase.com/docs/guides/platform/migrating-within-supabase/backup-restore) did not have any notice of this - Removed mention of storage and bucket configuration as that is stored in the database <img width="2840" height="1026" alt="Screen Capture 2026-11-23 at 17 19 34@2x" src="https://github.com/user-attachments/assets/b2e8af76-2c1c-4581-9b61-099773976211" /> - Document some differences between the clone and non cloning options - database extension - compute instance size, disk attributes, SSL enforcement settings, and network restrictions - Removed mention of database extensions in [Restore to a new project](https://supabase.com/docs/guides/platform/clone-project) as it is inconsistent with admonition later on in the doc: `Restore to a new project is a binary restore: it copies the entire database, including any enabled extensions` ## Preview [Backup Dashboard backup](https://supabase.com/docs/guides/platform/migrating-within-supabase/dashboard-restore) <img width="1410" height="664" alt="Screen Capture 2026-11-23 at 17 00 24@2x" src="https://github.com/user-attachments/assets/c73f6592-899f-4727-98c2-6bd17b894953" /> [Backup and Restore using the CLI](https://supabase.com/docs/guides/platform/migrating-within-supabase/backup-restore) <img width="1404" height="671" alt="Screen Capture 2026-11-23 at 17 00 41@2x" src="https://github.com/user-attachments/assets/d5beb415-f023-4910-a942-5a3486ee8b58" /> [Restore to a new project](https://supabase.com/docs/guides/platform/clone-project) <img width="1396" height="616" alt="Screen Capture 2026-11-23 at 17 01 02@2x" src="https://github.com/user-attachments/assets/00b19cdf-113d-4994-be09-24ddaf13a3f5" /> ## Checklist Check all before review: - [X] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [X] If I wrote a new docs topic or edited an existing topic, I used the `/review-the-docs` - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
9b5c1ebf0d |
docs(cli): document converting config back to TOML with --to toml (#53736)
## Problem CLI 3.3.0 added `supabase config convert --to toml` (supabase/cli#7741), a supported way to go from `config.jsonc` / `config.json` back to `config.toml`. The docs only cover converting to JSONC. The Branching troubleshooting page only offers a manual git restore for going back. ## Solution - `config-formats.mdx`: a new "Convert back to TOML" section. It covers what the command carries over, the `.bak` backup, the refusal when `config.toml` already exists, `--dry-run` and undo, and the optional reason prompt / `--reason` flag that's sent as telemetry. - `deployment/branching/troubleshooting.mdx`: "Wrong config file used" now points at `--to toml` first and keeps the git restore for CLIs earlier than 3.3.0. ## Review instructions 1. Open the Config formats and Branching troubleshooting pages on the preview. 2. Check the "Convert back to TOML" section and the link to it from the troubleshooting page. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
8728c41ad3 |
feat(studio): raise passkey relying party origins limit to 10 (#53735)
Raises the relying party origins limit in the Passkeys settings form and the passkeys guide from 5 to 10. |
||
|
|
6ed17bf700 |
docs(csharp): update SDK reference with latest changes (#53720)
Updates the .NET/C# SDK reference with latest changes |
||
|
|
4557c40bd1 |
docs: match the Laravel quickstart to the current project skeleton (#53796)
## Problem The Laravel quickstart has drifted from what `composer create-project laravel/laravel` generates today. Closes #53795. - Steps 2 and 4 link to the Laravel `12.x` docs. Laravel 13 is current. - Step 6 shows `'sslmode' => 'require'` hardcoded, but the generated `config/database.php` has read `sslmode` from `DB_SSLMODE` since [laravel/laravel#6727](https://github.com/laravel/laravel/pull/6727). - Step 5 says Laravel takes `sslmode` as a config option "rather than a URL parameter". A `?sslmode=` query on `DB_URL` works and overrides the config value. - The Laravel "Copy prompt" text never sets `sslmode`. ## Solution - Link to the unversioned Laravel docs so the links follow the current release. - Set `DB_SSLMODE=require` in the step 5 `.env` block and show the generated `sslmode` line unchanged in step 6. Step 6 is now a one-line `search_path` edit. - Remove the inaccurate sentence, and the paragraph that repeated the `prefer` and `require` guidance already given by the `quickstart_connection_string.mdx` partial. - Add `DB_SSLMODE=require` to the Laravel AI prompt. Tested on a fresh Laravel 13.43 app (PHP 8.5, Breeze 2.4.2) against Postgres 18 with SSL on: with the revised steps, `php artisan migrate` created all tables in the `laravel` schema, `pg_stat_ssl` showed the connection encrypted, and register and sign in worked. I tested against a local Postgres, not through the Supabase pooler. `prettier --check` passes on both files. I did not run the full docs build locally. ## Review instructions 1. Open the Laravel quickstart in the docs preview. 2. Check that the two Laravel docs links in steps 2 and 4 open the installation and authentication pages. 3. Run `composer create-project laravel/laravel example-app` and compare the `pgsql` block in `config/database.php` with step 6. Only `search_path` differs. 4. Click the AI prompt button and check that step 3 mentions `DB_SSLMODE=require`. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Checked against the style guide (voice, `WORD_LIST.md`, timeless documentation). |
||
|
|
70a9f46bad |
chore(docs) - add "change a region" to the regions page (#53032)
## Problem Missing from the regions page, but present at the bottom of https://supabase.com/docs/guides/platform/migrating-within-supabase#transfer-project-to-a-different-organization ## Solution Add to regions page. Most competitors have this as well: - https://planetscale.com/docs/plans/regions#changing-branch-and-database-regions - https://neon.com/docs/import/region-migration ## Preview links https://docs-git-docs-change-regions-supabase.vercel.app/docs/guides/platform/regions#change-a-region --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> |
||
|
|
5c26d14813 |
docs(realtime): use public.rooms_users consistently in authorization examples (#53624)
## Problem The Realtime Authorization guide creates `public.rooms_users`, but two paragraphs call it `public.room_users`, and the six example policies on `realtime.messages` use the bare name `rooms_users`. Someone copying from the page sees two table names and has to guess which one is right. ## Solution - Fix the name in the two paragraphs (`room_users` to `rooms_users`). - Write `public.rooms_users` in the six example policies, the same name the `create table` at the top of the page uses. Qualifying the table is also one of the first things suggested when debugging a private-channel policy in supabase/realtime#1111, so the examples now match that advice. Docs only, no behavior change. This PR was prepared with AI assistance and reviewed before opening. Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
f1e56e127f |
fix(docs): broadcast Realtime DELETE events to the record topic (#53579)
Closes #53584 ## Problem Two Realtime guides attach `realtime.broadcast_changes` triggers that fire on `DELETE`: - `apps/docs/content/guides/realtime/broadcast.mdx` — `your_table_changes`, used by a trigger declared `AFTER INSERT OR UPDATE OR DELETE` - `apps/docs/content/guides/realtime/getting_started.mdx` — `broadcast_message_changes`, used by a trigger declared `AFTER INSERT OR UPDATE OR DELETE` Both build the broadcast topic from the new row only: ```sql 'topic:' || NEW.id::text 'room:' || NEW.room_id::text || ':messages' ``` On `DELETE`, `NEW` is `NULL`, so the concatenation produces a `NULL` topic. `realtime.broadcast_changes` passes that to `realtime.send`, which inserts into `realtime.messages`. In `supabase/realtime`, `realtime.messages.topic` is `text not null`, and `realtime.send` wraps its insert in an exception handler that downgrades the failure to a warning: ```sql EXCEPTION WHEN OTHERS THEN RAISE WARNING 'WarnSendingBroadcastMessage: %', SQLERRM; ``` So the trigger succeeds, logs only a warning, and no `DELETE` message reaches subscribers. The sibling guide already handles this correctly: `subscribing-to-database-changes.mdx` uses `coalesce(NEW.id, OLD.id)`. ## Fix Use `coalesce(NEW.id, OLD.id)` in `broadcast.mdx` and `coalesce(NEW.room_id, OLD.room_id)` in `getting_started.mdx`, matching `subscribing-to-database-changes.mdx` so all three guides teach the same pattern. The `realtime.send` example in `getting_started.mdx` is unchanged because its trigger is `AFTER INSERT` only, where `NEW` is always present. One caveat: `coalesce` falls back to `OLD` whenever `NEW` is null, including an `UPDATE` that clears a nullable `room_id`. That broadcasts to the former room, where the `CASE` form would emit a null topic and send nothing. The example reads as if a message always belongs to a room; for a schema where `room_id` can be cleared, use `CASE WHEN TG_OP = 'DELETE' THEN OLD.room_id ELSE NEW.room_id END`. ## Verification I tested the exact edited SQL blocks against `supabase/postgres:17.6.1.143`, using the real `realtime.broadcast_changes` and `realtime.send` definitions from `supabase/realtime` and a `realtime.messages` table that keeps the production `topic text not null` constraint. Before the fix, running `INSERT`, `UPDATE`, then `DELETE` on the `getting_started.mdx` snippet: ```text WARNING: WarnSendingBroadcastMessage: syntax error at or near "NULL" event | topic | op --------+-----------------+-------- INSERT | room:7:messages | INSERT UPDATE | room:7:messages | UPDATE (2 rows) ``` After the fix, running insert, update body, update `room_id` to `NULL`, move to room 9, then delete: ```text event | topic | op | new_room | old_room --------+-----------------+--------+----------+---------- INSERT | room:7:messages | INSERT | 7 | UPDATE | room:7:messages | UPDATE | 7 | 7 UPDATE | room:7:messages | UPDATE | | 7 UPDATE | room:9:messages | UPDATE | 9 | DELETE | room:9:messages | DELETE | | 9 (5 rows) ``` The `room_id` to `NULL` update follows the caveat above; `INSERT`, a normal `UPDATE`, a room move, and `DELETE` all use the expected topic. The `broadcast.mdx` snippet produces `INSERT`/`UPDATE`/`DELETE` messages with `topic:<id>`. Prettier passes on both files. ## Authorship and review This PR is written by me. AI assisted with drafting and with setting up the test harness, but I reviewed and audited every change myself and I stand behind it. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
a74afc61cd |
docs(hypopg): fix function names in the functions list (#53514)
## Problem Three entries in the [HypoPG functions list](https://supabase.com/docs/guides/database/extensions/hypopg#functions) name functions that don't exist, so copying them fails with `function ... does not exist`: - `hypo_create_index(text)` is `hypopg_create_index(text)` (the example on the same page already uses it) - `hypopg_get_index_def(oid)` is `hypopg_get_indexdef(oid)` - `hypopg_get_relation_size(oid)` is `hypopg_relation_size(oid)` Source: [`hypopg--1.4.5.sql`](https://github.com/HypoPG/hypopg/blob/REL1_STABLE/hypopg--1.4.5.sql) and the upstream [usage docs](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes). ## Solution Use the real function names. ## Review instructions 1. Compare the list with the `CREATE FUNCTION` statements in the linked `hypopg--1.4.5.sql`. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
9964968b53 |
docs(auth): explain that supabase-js refreshes the session automatically (#53698)
## Problem The User sessions guide explains what refreshing the session means, but not who does it. Readers building browser apps can't tell whether they need to write their own refresh logic for when the access token expires. Related to [FDBKIN-12783](https://linear.app/supabase/issue/FDBKIN-12783/provide-clear-documentation-and-examples-for-jwt-refresh-in-react) Closes [DOCS-1718](https://linear.app/supabase/issue/DOCS-1718/explain-that-supabase-js-refreshes-the-session-automatically-in-the) ## Solution The "What is a session?" section of `/guides/auth/sessions` now says, right after the refreshing-the-session sentence, that `supabase-js` refreshes the session on its own (`autoRefreshToken` defaults to `true`), so a browser app needs no refresh code. It notes that auto refresh pauses while the tab is hidden and checks the session again when the tab is visible. It shows a minimal `onAuthStateChange` listener for the `TOKEN_REFRESHED` event and points to `refreshSession()` for a forced refresh. Timing is described qualitatively, so the text stays true if the client's intervals change. ## Checks The facts come from `@supabase/auth-js` 2.117.3: the default `autoRefreshToken: true` in `GoTrueClient.ts`, the visibility handling in `_onVisibilityChanged`, and the tick and expiry-margin constants in `lib/constants.ts`. The code block on the page, with its hidden setup above `// ---cut---`, passes `tsc --strict` against `@supabase/supabase-js` 2.117.3. Also ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'` and Prettier on the changed file, and all passed. The reference link slugs `auth-onauthstatechange` and `auth-refreshsession` come from `apps/docs/spec/common-client-libs-sections.json`. A second reader reviewed the change against the style guide. ### How to verify 1. On the preview, `/docs/guides/auth/sessions` shows the new paragraphs under "What is a session?", directly after "This process is called refreshing the session." 2. The note says `supabase-js` refreshes the session automatically with `autoRefreshToken` defaulting to `true`, says auto refresh pauses while the tab is hidden, and names `TOKEN_REFRESHED` and `refreshSession()`. 3. The code block shows only the `onAuthStateChange` listener; the client setup is hidden. 4. The `onAuthStateChange` and `refreshSession()` links open their JavaScript reference entries. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
5fb0be08b1 |
docs: say where to reset the database password in the connection guide (#53697)
## Problem Step 4 of "Get your connection string" in the Postgres connection guide tells readers to put their database password in the connection string. It doesn't say that the dashboard stops showing the password after the project is created, or how to get a new one. Related to [FDBKIN-4770](https://linear.app/supabase/issue/FDBKIN-4770/improve-documentation-and-navigation-for-finding-the-database-password) Closes [DOCS-1717](https://linear.app/supabase/issue/DOCS-1717/say-where-to-reset-the-database-password-in-the-connection-guide) ## Solution A new paragraph, indented under step 4 of `/guides/database/connecting-to-postgres`, says that the dashboard doesn't show the database password after you create the project. It points readers to the **Reset database password** option in the Connect dialog and to the Database Settings section (`#database-password`), and warns that a reset breaks existing connections that use the old password. The wording matches the quickstart connection-string partial and the dashboard's own copy. Step 4's own text, including the percent-encoding guidance, is unchanged, and no other section changes. ## Checks I ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed file. All of them pass. I checked the facts against the Studio code: the `database-password` section and its copy in `ResetDbPassword.tsx`, and the **Reset database password** button in the Connect sheet's connection step. The `docs` tests were skipped because they need Docker. On the preview, step 4 of "Get your connection string" should: - keep its original text, with a second paragraph that stays inside step 4 - say in that paragraph that the Supabase Dashboard doesn't show the database password after you create the project - name **Reset database password** and say that a reset breaks existing connections - link Database Settings to the dashboard's database settings page, at `#database-password` ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
57e5db42e2 |
docs(auth): explain how to verify JWTs without reaching the JWKS endpoint (#53696)
## Problem The signing keys guide explains how to verify asymmetric JWTs with the JWKS discovery endpoint and its caches. It doesn't help readers whose backend can't make outbound requests to that endpoint. Related to [FDBKIN-21659](https://linear.app/supabase/issue/FDBKIN-21659/improve-guidance-on-verifying-ecc-jwts-in-environments-with-network) Closes [DOCS-1716](https://linear.app/supabase/issue/DOCS-1716/explain-how-to-verify-jwts-when-the-backend-cant-reach-the-jwks) ## Solution A note at the end of "Public key discovery and caching" on `/guides/auth/signing-keys` explains how to copy the public keys into the app and load them at startup. It names the two ways to get the keys: request the discovery endpoint from a machine that can reach it, or copy each key's key set from the dashboard. Because copied keys are a cache that never expires, the note asks readers to copy every asymmetric key that isn't revoked (including a previously used key, which stays trusted after a rotation), to add a standby key before rotating to it, and to remove a revoked key by hand. Existing text in the section is unchanged. "Verifying a JWT from Supabase" on `/guides/auth/jwts` gets one sentence that links to the note, right after its advice not to cache the key set for longer, so readers who start from JWT verification find the option. Existing text on that page is unchanged. ## How to verify 1. On the docs preview, open `/docs/guides/auth/signing-keys`. 2. The note is the last content of "Public key discovery and caching", just before "Choosing the right signing algorithm". 3. The dashboard steps use the Studio labels **More options**, **View key details**, and **Public key set (JSON Web Key Set format)**, and the JWT signing keys link opens the dashboard's JWT settings. 4. The note says to add a standby key to the app before rotating to it and to remove a revoked key by hand. 5. On the docs preview, open `/docs/guides/auth/jwts`. In "Verifying a JWT from Supabase", the paragraph after "Make sure that you do not cache this data for longer" links to "Public key discovery and caching", and the link scrolls to that heading on the signing keys page. ## Checks Ran `pnpm turbo run lint` and `pnpm turbo run typecheck` filtered to the branch's changes, and Prettier on the changed files; all pass. UI labels and the single-key key set were checked against `apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/key-details-dialog.tsx` and `signing-key-row.tsx`. Key trust across rotation was checked against the key lifetime table on the same page. The link's anchor was checked against the heading slug that `getAnchor` in `packages/ui` generates. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |