mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
create-pull-request/patch
536
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7c9b65e21d |
docs(auth): say where proxy.ts goes in a Next.js project with a src folder (#54556)
## Problem The Next.js setup in the server-side client guide doesn't say where to put the `proxy.ts` (or `middleware.ts`) file. The Next.js user management tutorial tells readers to put it at the project root. In a project that uses a `src` folder, a file at the project root never runs, sessions don't refresh, and nothing reports an error. Related to [FDBKIN-6704](https://linear.app/supabase/issue/FDBKIN-6704/clarify-middlewarets-file-placement-for-nextjs-ssr-in-documentation) Closes [DOCS-1851](https://linear.app/supabase/issue/DOCS-1851/say-where-proxyts-goes-in-a-nextjs-project-that-uses-a-src-folder) ## Solution The "Hook up proxy" section of the Next.js tab now opens by saying where the file goes: at the same level as the `app` or `pages` folder, which is the project root or the `src` folder. It covers `middleware.ts` on Next.js 15 and earlier, and warns that Next.js silently skips the file anywhere else. It follows the wording the page already uses for the `lib/supabase` folder and doesn't repeat the existing rename note. The Next.js tutorial gets the same placement note in its "Next.js proxy" step. Its "Supabase utilities" step now also says the `lib/supabase` folder goes inside `src` in a `src` project, because the `@/` import alias points there and the proxy import doesn't resolve otherwise. ## How to verify 1. Open https://docs-git-tedd-docs-1851-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client?queryGroups=framework&framework=nextjs#hook-up-proxy and https://docs-git-tedd-docs-1851-supabase.vercel.app/docs/guides/getting-started/tutorials/with-nextjs#nextjs-proxy. 2. The guide's section says to put `proxy.ts` at the same level as `app` or `pages`: the project root, or the `./src` folder when the project uses one. 3. The guide's section says `middleware.ts` goes in the same place on Next.js 15 and earlier. 4. The guide's section says Next.js doesn't run the file from any other location and shows no error. 5. The tutorial's "Next.js proxy" step says to put `proxy.ts` at the same level as `app` (the project root or `./src`), and that Next.js doesn't run it from any other location and shows no error. 6. The tutorial's "Supabase utilities" step says to put the `lib/supabase` folder at the project root, or inside `./src` when the project uses one. ## Checks Ran `pnpm turbo run lint --filter='[origin/master]'` and `pnpm exec oxfmt --check` on the changed files. The change is MDX prose only, so no typecheck or tests cover it. Facts checked against the Next.js `proxy.js`, `middleware.js`, and `src` folder references and the Next.js build source. They were confirmed with `next build` and `next start` on test projects with the files in and out of `src`, including `create-next-app` scaffolds with and without `--src-dir`. ## 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-1851](https://linear.app/supabase/issue/DOCS-1851/say-where-proxyts-goes-in-a-nextjs-project-that-uses-a-src-folder). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: alexisintech <98043211+alexisintech@users.noreply.github.com> |
||
|
|
ccabb68033 |
fix(docs,examples): keep auth callback redirects within the app (#54500)
## Problem Several auth callback and email confirmation examples redirect to the `next` query parameter without checking it. A reader who copies one gets an open redirect: anyone can send a sign-in link with `next` set to another site, and the app sends the signed-in user there. The affected examples are the SvelteKit, Astro, Remix, and Express tabs of the PKCE flow partial, which all social sign-in pages include, and the Next.js, Astro, Remix, and Express email confirmation handlers in the password guide. The SvelteKit and Express tabs had a partial check, but `//evil.com` and `/\evil.com` still got through. The SvelteKit confirmation tabs and the Next.js reset tab in the password guide copy `next` into the URL path. That keeps the user on the same site, but turns a full URL into a broken path. The example apps under `examples/` have the same problem. The Next.js email confirmation route in `examples/auth/nextjs-full` has the same open redirect. Two SvelteKit example apps copy `next` into the URL path, which keeps the user on the same site but turns a full URL into a broken path. Resolves [DOCS-1836](https://linear.app/supabase/issue/DOCS-1836/make-the-auth-callback-examples-redirect-only-within-the-app), [DOCS-1840](https://linear.app/supabase/issue/DOCS-1840/make-the-auth-examples-under-examples-redirect-only-within-the-app), and [DOCS-1844](https://linear.app/supabase/issue/DOCS-1844/handle-full-url-and-query-string-next-values-in-the-confirmation). ## Solution Each example now reads `next` as a URL against the request's own origin. It keeps `next` only when the result uses `http` or `https`, has the request's host, and its path doesn't start with `//`, then redirects to that path. Anything else falls back to `/`. The examples accept same-site full URLs as well as paths. The signup email template on the password page sends `next={{ .RedirectTo }}`, which is always a full URL, so a path-only check would send every new user to `/`. #51567 proposed a path-only check for the same examples, and this PR builds on it with full-URL support. The redirect itself stays relative. An absolute URL built from the request origin can point to an internal host when the app runs behind a proxy. `URL.parse()` returns `null` for malformed input, so a bad `next` value or `Host` header falls back to `/` instead of throwing. Each check compares the host of `next` with the request's host. Behind a proxy that terminates HTTPS, Express reports the request as `http`, so comparing full origins would send every full-URL `next` to `/`. The redirect carries only the path, so the scheme doesn't affect where the user lands. Other schemes are rejected, because a URL such as `custom://example.com/\evil.com` keeps the backslash in its path, and browsers read `/\evil.com` as another site. The Express examples also read `next` only when it's a string, because the Express 4 query parser can return an object. The Next.js tab of the PKCE partial already stays on the same site, so it's unchanged. The SvelteKit confirmation tabs and the Next.js reset tab in the password guide get the same check as the other tabs. On success they redirect to the checked value. On failure, the SvelteKit tabs redirect to a fixed error page. The Next.js reset tab now matches the signup tab, so its redirect no longer carries `token_hash` and `type`. The email confirmation routes in three example apps get the same check: `examples/auth/nextjs-full`, `examples/auth/sveltekit-full`, and `examples/user-management/sveltekit-user-management`. The user management example falls back to `/account`, the page its tutorial sends users to. In the SvelteKit routes, a successful confirmation redirects straight to the checked value, and a failed one redirects to a fixed error page. Other query parameters on the confirmation link no longer carry over. The Next.js example pins TypeScript 5.9.3, because TypeScript 5.3 has no type for `URL.parse` and `next build` failed its type check. The SvelteKit tutorial embeds the user management route, so the tutorial shows the new code. ## Verification (`/test-the-docs`) Each handler was extracted by script from the MDX on this branch, on `master`, and on #51567, then mounted in a minimal app for its framework. Each app ran against a local Supabase stack in the Compose sandbox. Confirm handlers got a fresh `generateLink` token hash per case. PKCE callbacks got a real code from a PKCE magic-link sign-in through Mailpit, with the code verifier cookie. Each route ran 12 `next` cases: none, `/welcome`, `/account?tab=1`, a same-site full URL, `//evil.com`, `/\evil.com`, `https://evil.com/x`, `javascript:alert(1)`, `http://`, `/<tab>/evil.com`, `/.//evil.com`, and `/a/..//evil.com`. The same-site full URL uses the origin each server reports for itself. | Example | Framework | This branch | `master` | | --- | --- | --- | --- | | PKCE partial, SvelteKit tab | SvelteKit 2.70 + adapter-node | pass 12/12 | 2 cases off-site | | PKCE partial, Astro tab | Astro 7.4 + @astrojs/node | pass 12/12 with `Astro.*` patched (see below) | 5 cases off-site | | PKCE partial, Remix tab | Remix 2.17 | pass 12/12 | 5 cases off-site | | PKCE partial, Express tab | Express 5.3 | pass 12/12 | 2 cases off-site | | Password signup, Next.js tab | Next.js 16.5 | pass 12/12 | 5 cases off-site | | Password signup and reset, Astro tabs | Astro 7.4 | pass 12/12 each | 5 cases off-site each | | Password signup and reset, Remix tabs | Remix 2.17 | pass 12/12 each | 5 cases off-site each | | Password signup and reset, Express tabs | Express 5.3 | pass 12/12 each | 2 cases off-site each | - `next build` type-checks the Next.js handler. `tsc --strict` reports the same errors for the Remix and Astro handlers as on `master`. - Express falls back to `/` on a malformed `Host` header without crashing. - #51567 also kept every route on the same site, and sent the same-site full URL case to `/`. - The unchanged examples stay on the same site in every case. - After review, each of the 14 changed blocks ran in Node 22 against 32 `next` values. The cases include Express behind an HTTPS proxy, an object `next` from the Express 4 query parser, and custom-scheme URLs with a backslash in the path. - The SvelteKit signup and reset tabs and the Next.js reset tab also ran end to end in Node 22, with `redirect` and `verifyOtp` stubbed. A same-site full URL lands on its path, `/account?tab=1` keeps its query, and the error page URL has no `token_hash` or `type`. On `master`, the same cases redirect to `/https://…`, to `/account%3Ftab=1`, and, in the Next.js reset tab, to a URL that still carries `token_hash`. ### Example apps Each example app was built and run in the Compose sandbox against a local Supabase stack. Every case used a fresh signup token, so each request ran a real `verifyOtp` and set a session cookie. The `sveltekit-full` example has no build setup of its own, so its route ran inside the user management app. Each route ran the 12 cases above, plus the same host on the other scheme and an `ftp://` URL on the same host, plus an invalid token to check the error redirect. | Example | Framework | This branch | `master` | | --- | --- | --- | --- | | `auth/nextjs-full` | Next.js 16.5 | pass 14/14, error path passes | 5 cases off-site | | `user-management/sveltekit-user-management` | SvelteKit 2.70 | pass 14/14, error path passes | on-site, but 9 of 12 cases land on a broken path | | `auth/sveltekit-full` | SvelteKit 2.70 | pass 14/14, error path passes | on-site, but 9 of 12 cases land on a broken path | - `next build` passes. With TypeScript 5.3.3, it fails with `Property 'parse' does not exist`. - `svelte-check` reports the same 7 errors on this branch and on `master`, all in the database types and the account form. None are in the confirm route. - Behind a proxy without forwarded-host handling, `next start` sees `localhost:3000`, so a full-URL `next` falls back to the default page there. ### Found while testing, not changed here These problems are on `master` too, and they're outside the scope of this fix: - PKCE partial, Astro tab: `Astro.request` and `Astro.cookies` don't exist in an API route, so the callback returns a 500 error. Tracked in [DOCS-1841](https://linear.app/supabase/issue/DOCS-1841/make-the-astro-oauth-callback-example-run-in-an-api-route). - Password guide, Remix confirm tabs: `setAll(key, value, options)` doesn't match the `@supabase/ssr` signature, so no session cookie is set after confirming. Tracked in [DOCS-1842](https://linear.app/supabase/issue/DOCS-1842/make-the-remix-email-confirmation-examples-set-the-session-cookie). - Password guide, Express confirm tabs: no `return` after the success redirect, so the error redirect also runs. Express 5 logs `ERR_HTTP_HEADERS_SENT`, and Express 4 exits the process. Tracked in [DOCS-1843](https://linear.app/supabase/issue/DOCS-1843/stop-the-express-email-confirmation-examples-from-redirecting-twice). - PKCE partial, Express tab: the callback ignores the result of `exchangeCodeForSession`, so a missing code or a failed exchange still redirects to `next`. Tracked in [DOCS-1845](https://linear.app/supabase/issue/DOCS-1845/send-failed-code-exchanges-to-the-error-page-in-the-express-oauth). - PKCE partial and password guide, Astro tabs: `setAll` drops the cache headers that `@supabase/ssr` passes with the session cookies. Tracked in [DOCS-1846](https://linear.app/supabase/issue/DOCS-1846/apply-the-cache-headers-from-supabasessr-in-the-astro-auth-callback). - Email templates guide, server-side endpoint example: it redirects to `redirect_to` without checking it. Tracked in [DOCS-1847](https://linear.app/supabase/issue/DOCS-1847/check-redirect-to-before-redirecting-in-the-server-side-email-template). - Next.js examples in the PKCE partial, the password guide, and the WorkOS and Google sign-in guides: they import the Supabase clients from `@/utils/supabase/`, but the client guide now creates them in `lib/supabase/`. Tracked in [DOCS-1848](https://linear.app/supabase/issue/DOCS-1848/import-the-nextjs-supabase-clients-from-libsupabase-in-the-auth). ## Review category (docs PRs only) - [ ] Critical: needs a review as soon as possible - [ ] Urgent: the feature ships soon, or it's blocking something else - [ ] Moderate: good to have soon, not urgent - [x] Low: get to it when you can ## Review instructions 1. Check that each changed example only touches the `next` handling and its redirect. 2. Check the changed tabs on the preview: - [GitHub sign-in page on the preview](https://docs-git-alexisa-docs-1836-supabase.vercel.app/docs/guides/auth/social-sign-in/auth-github): the callback code for the SvelteKit, Astro, Remix, and Express tabs. Every social sign-in page includes this partial. - [Password guide on the preview](https://docs-git-alexisa-docs-1836-supabase.vercel.app/docs/guides/auth/passwords): under PKCE flow, every framework tab for signup confirmation and password reset. - [SvelteKit tutorial on the preview](https://docs-git-alexisa-docs-1836-supabase.vercel.app/docs/guides/getting-started/tutorials/with-sveltekit#confirmation-endpoint): the confirmation endpoint embeds the user management example's route. 3. Check the three confirm routes under `examples/` and the `typescript` pin in `examples/auth/nextjs-full/package.json`. ## 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). Not used: only code inside existing snippets and example apps changed, no prose. The snippets were verified with `/test-the-docs`. |
||
|
|
874fbcae03 |
Fix grammatical errors in error codes documentation (#54534)
## Problem While reviewing the Auth error codes documentation for troubleshooting, I noticed several minor grammar and readability inconsistencies throughout the guide. For example, in the HTTP status codes section, the 500 error uses "Indicate" instead of "Indicates" (breaking the verb tense pattern of the other bullets). Additionally, some sentences in the guide were slightly run-on or lacked proper commas, making them harder to read. There is no specific GitHub issue for this; it is a general documentation cleanup. ## Solution I corrected grammatical errors and improved sentence flow for better readability across the Auth error codes page. Key changes include: - Adding missing commas for readability (e.g., "Client errors differ by language, so do refer...") - Fixing verb tenses to match list formats (e.g., "Indicates that the Auth server...") - No technical content, code snippets, or error code definitions were changed. ## Review category (docs PRs only) - [x] Low: get to it when you can ## Review instructions 1. Open the changed file `apps/docs/content/guides/auth/debugging/error-codes.mdx` and review the diff. 2. Confirm that the grammatical changes do not alter the technical meaning of the Auth error codes. 3. Ensure the `<$Show>` conditional tags remain intact and untouched. ## 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) |
||
|
|
c9bb8cd1c4 |
fix(docs): fix the accessibility scan violations on 4 guides (#54497)
## Problem The daily Docs Accessibility Scan fails on 5 guides with blocking violations, tracked in [DOCS-1817](https://linear.app/supabase/issue/DOCS-1817/fix-the-accessibility-issues-the-daily-docs-scan-finds-on-5-guides). This PR fixes 4 of them. - Deep linking, Expo social sign-in, and push notifications repeat the same heading text in several tabs, so two or more headings get the same `id`. Deep linking also includes the "Universal links" partial twice. Screen readers and in-page links can land on the wrong heading. - On Resources, the "Migrate to Supabase" heading is an `h3` with no `h2` above it. The [run on 2026-12-02](https://github.com/supabase/supabase/actions/runs/46817154464) also failed on 8 pages that returned 404. Those pages had merged to `master` during a code freeze, so production didn't serve them yet. They return 200 now, and [DOCS-1839](https://linear.app/supabase/issue/DOCS-1839/scan-only-the-pages-production-serves-in-the-daily-docs-accessibility) tracks keeping the scan from failing that way. ## Solution - **Repeated headings in content:** The first copy of each heading keeps its anchor. Each later copy gets a custom anchor named after its tab, such as `#deep-link-config-swift`. The partial takes an anchor suffix through `variables`, so each include gets its own anchor. No page in the repo links to the changed anchors, and the visible heading text stays the same. - **Resources:** The "Migrate to Supabase" and "Postgres resources" headings are now `h2`. Their anchors stay the same, so the blog posts that link to `#migrate-to-supabase` keep working. The headings render at `h2` size. Advisors also has duplicate heading `id` values. #53313 fixes them by giving IDs only to the open tab, which keeps links to each lint's headings working. This PR leaves Advisors to #53313. ## Preview links | Guide | Live | Preview | Check | | -- | -- | -- | -- | | Deep linking | [/docs/guides/auth/native-mobile-deep-linking](https://supabase.com/docs/guides/auth/native-mobile-deep-linking) | [Swift tab, Deep link config](https://docs-git-alexisa-docs-1817-supabase.vercel.app/docs/guides/auth/native-mobile-deep-linking?queryGroups=platform&platform=swift#deep-link-config-swift) | `#deep-link-config`, `#universal-links` | | Expo social sign-in | [/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in](https://supabase.com/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) | [Expo tab, Prerequisites](https://docs-git-alexisa-docs-1817-supabase.vercel.app/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in?queryGroups=apple-authentication&apple-authentication=expo-apple-authentication#prerequisites-expo) | `#prerequisites`, `#ios` | | Push notifications | [/docs/guides/functions/examples/push-notifications](https://supabase.com/docs/guides/functions/examples/push-notifications) | [FCM tab, Supabase setup](https://docs-git-alexisa-docs-1817-supabase.vercel.app/docs/guides/functions/examples/push-notifications?queryGroups=platform&platform=fcm#supabase-setup-fcm) | `#supabase-setup`, `#send-push-notification` | | Resources | [/docs/guides/resources](https://supabase.com/docs/guides/resources) | [Migrate to Supabase](https://docs-git-alexisa-docs-1817-supabase.vercel.app/docs/guides/resources#migrate-to-supabase) | "Migrate to Supabase" and "Postgres resources" are `h2` | ## Verification - The `@a11y` spec passes for the 4 fixed guides on the preview deployment and against a local docs server, run through `pnpm e2e:docs:a11y`. - The rendered HTML for each guide has no duplicate `id` values. - `pnpm check:removed-anchors --base origin/master` reports no removed linked anchors. - The markdown export (`pnpm build:guides-markdown`) shows the original heading text without the custom anchors. - Docs typecheck, ESLint, and oxfmt pass on the changed files. ## Review category (docs PRs only) - [ ] Critical: needs a review as soon as possible - [ ] Urgent: the feature ships soon, or it's blocking something else - [x] Moderate: good to have soon, not urgent - [ ] Low: get to it when you can ## Review instructions 1. Open each preview link in the table above. Each one opens the right tab at a heading that changed. 2. In the browser console, run `document.querySelectorAll('[id="<anchor>"]').length` for each anchor in the **Check** column. Each returns `1`. 3. On the Resources preview, check that "Migrate to Supabase" and "Postgres resources" are `h2` headings. ## Checklist - [ ] 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) Part of [DOCS-1817](https://linear.app/supabase/issue/DOCS-1817/fix-the-accessibility-issues-the-daily-docs-scan-finds-on-5-guides). |
||
|
|
b3ddaa053a |
docs: fix grammar in sessions guide (#54212)
Fixes two small grammar errors in the User sessions guide: "All requests that require authentication has" → "have", and "termination of user's sessions" → "termination of users' sessions". Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
46a27e1aaf |
docs: fix grammar in signout guide (#54218)
Fixes a grammar error in the Sign out and scopes section of the signout guide by changing "but keep sessions" to "but keeps sessions". Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
7d9cbcd2aa |
docs: fix grammar in managing user data guide (#54217)
Fixes a grammar error in the Exporting users section of the managing user data guide by changing "table" to "tables". Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
77f33f115b |
fix(docs): use the OAuth client columns in the audit query (#54098)
## Problem Fixes #54097. The OAuth token security guide's audit query uses columns that no longer exist. `oauth_clients.client_id` was dropped in auth migration `20250903112500`, and `id` is now the public client ID. The table has `client_name`, not `name`, and `sessions` stores the client in `oauth_client_id`, which references `oauth_clients.id`. The query also filters on `s.created_at`. Sessions last indefinitely and are refreshed while a user stays active, so a long-lived session refreshed yesterday is excluded. ## Solution - Select `oc.id AS client_id` and group by `oc.id`. - Use `oc.client_name`. - Join on `s.oauth_client_id = oc.id`. - Put the 30-day window in the join on `coalesce(s.refreshed_at, s.created_at)`, so sessions created or refreshed in the last 30 days count and clients with a count of 0 remain. - Name the count `users_with_recent_sessions` so it describes the measure. This changes one SQL block in one `.mdx` file. ## Verification Checked against the auth schema from the `supabase/auth` migrations, including `sessions.refreshed_at`. Tested on `supabase/postgres:17.6.1.143` with `auth.oauth_clients` and `auth.sessions` tables that match the current columns. The previous query fails with `column oc.client_id does not exist`. With a session created 60 days ago and refreshed yesterday, the creation-time filter returns `0`, while the refresh-time filter returns `1`. A new session with no refresh still counts through the `created_at` fallback, and a client with no sessions returns `0`. ## Review instructions 1. Open `apps/docs/content/guides/auth/oauth-server/token-security.mdx`. 2. Confirm the audit query selects `oc.id AS client_id`, uses `oc.client_name`, joins on `s.oauth_client_id = oc.id`, and filters on `coalesce(s.refreshed_at, s.created_at)` inside the join. 3. Run the query against a project with the OAuth server enabled. It should return every client with the number of users whose session was created or refreshed in the last 30 days. ## 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> |
||
|
|
58b468916c |
docs(auth): Solve eval for Anonymous sign-in page (#53489)
Closes DOCS-1676 ## Problem The drafted Eval for this guide has one failing check. This PR fixes that check and also runs the `edit-the-docs` and `test-the-docs` skill to improve the page as a whole. The Anonymous Sign-Ins guide tells readers to check the `is_anonymous` JWT claim in RLS policies. When a guest links an email, phone, or OAuth identity, the user becomes permanent at once, but the token the client holds keeps `is_anonymous: true` until it refreshes. A policy on the claim refuses that new customer with `42501` until then. ## What changed - **Access control:** a caution on the stale claim, and a policy that reads `auth.users.is_anonymous` through a `security definer` function in a non-exposed schema with `search_path = ''`. - **Convert an anonymous user:** a "Refresh the session after linking" step with `refreshSession()`. - **Whole-page edit**, one commit per change type: - Style: wording, word list, sentence-case and imperative headings, no time-anchored text. - Structure (moves only): Access control before Convert, identity conflicts under Convert, the Next.js caution under Sign in. - Technical: the `anon` key uses the `anon` role, not `anonymous`; the opening caution no longer says to check the JWT claim; the existing-account sample throws instead of a top-level `return`. Renamed headings with no inbound links: Resolving identity conflicts, Linking an anonymous user to an existing account, Automatic cleanup. `#access-control` (Studio) and `#link-an-email--phone-identity` are unchanged. ## Eval on the preview `build-docs-016-auth-anonymous` with `REFERENCE` pointed at the preview, 3 runs ([workflow run](https://github.com/supabase/evals/actions/runs/43983385855)). | Run | Score | Guest who just made an account can post a review | Failed check | | --- | --- | --- | --- | | Baseline (published page) | 9/10 in all 3 runs | Fail in all 3 | Guest who just made an account can post a review | | 1 | 10/10 | Pass | None | | 2 | 9/10 | Pass | Agent read the guide | | 3 | 9/10 | Pass | Agent read the guide | All 3 runs fetched the preview and wrote the `security definer` policy. The guide-read check only counts fetches from `supabase.com`, so it can't pass on a preview. Run 1 passed it because that agent also opened the published page. ## Manual testing 1. Open the [Anonymous sign-ins preview](https://docs-git-docs-anonymous-claim-refresh-supabase.vercel.app/docs/guides/auth/auth-anonymous). 2. Check the new caution and function example under **Access control**, and the new **Refresh the session after linking** section. 3. Click the anchor links between the two sections and to the RLS guide. |
||
|
|
7c57f91538 |
docs: Solve eval for Enable email OTP (#54327)
## Problem
The passwordless email guide says to add `{{ .Token }}` to the **Magic
link or OTP** template to send a code. When email confirmations are on,
a first-time sign-in sends the **Confirm sign up** email instead, so new
users still get a link. This is the failure the passwordless email guide
eval catches.
Closes DOCS-1814
## Solution
This PR solves the Eval checks.
**Enable email OTP** now covers both templates:
- It says which template each user gets.
- It has you add `{{ .Token }}` to both **Magic link or OTP** and
**Confirm sign up**.
- It notes that a link left in either template still works.
The rest of the PR is style, structure, and template changes. Existing
anchors still resolve.
## Manual testing
1. Open the [preview
page](https://docs-git-docs-email-otp-confirm-signup-supabase.vercel.app/docs/guides/auth/auth-email-passwordless#enabling-email-otp)
and check that it lands on **Enable email OTP**.
2. Click the **Magic link or OTP** and **Confirm sign up** template
links and check that each opens its template in the dashboard.
|
||
|
|
530ae14dab |
docs(auth): remove claims of automatic cleanup of expired sessions (#54123)
Removes section from the doc stating the sessions are automatically deleted after 24 hours of expiry. Co-authored-by: Claude <noreply@anthropic.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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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) |
||
|
|
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> |
||
|
|
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)
|
||
|
|
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> |
||
|
|
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. |
||
|
|
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> |
||
|
|
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> |
||
|
|
edece97bdc |
docs(auth): explain why the signup trigger must schema-qualify names (#53695)
## Problem The User Management guide shows a trigger that copies new users into `public.profiles`, but it doesn't say why the function sets `search_path = ''` and writes `public.profiles` in full. A reader who drops the schema from a table name breaks every sign-up, and the page doesn't connect that to the `Database error saving new user` response. Related to [FDBKIN-40810](https://linear.app/supabase/issue/FDBKIN-40810/document-best-practices-for-security-definer-triggers-on-authusers) Closes [DOCS-1715](https://linear.app/supabase/issue/DOCS-1715/explain-why-the-signup-trigger-must-schema-qualify-tables) ## Solution A caution admonition right after the trigger example on `/guides/auth/managing-user-data` tells readers to schema-qualify every non-built-in name in the function, such as `public.profiles`. It explains that the function sets `search_path = ''`, so Postgres can't find an unqualified name, the trigger fails, and every sign-up fails with `Database error saving new user`. The note leaves out the Auth role's own search path, because it doesn't apply once the function sets an empty one. For why the search path stays empty, it links to the "Security `definer` vs `invoker`" section of the database functions guide instead of repeating it. The SQL example and the rest of the page are unchanged. ## How to verify 1. On the preview, open `/docs/guides/auth/managing-user-data`. 2. Right after the `handle_new_user` / `on_auth_user_created` SQL example, a caution note says to schema-qualify names such as `public.profiles`, says the function's `search_path = ''` is why an unqualified name fails, and gives the `Database error saving new user` error. 3. The note's link opens the "Security `definer` vs `invoker`" section of `/docs/guides/database/functions`. 4. No other text on the page changed. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'` (0 errors), and Prettier `--check` on the changed file. The error string was checked against `supabase/auth` `internal/api/signup.go` (`signupNewUser` returns `Database error saving new user` when the user insert fails). The docs tests were skipped because they need Docker. A second reader reviewed the change against the style guide. ## 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> |
||
|
|
fbd1e34128 |
docs(auth): note that the Kotlin Auth plugin can't be used with Firebase accessToken (#53692)
## Problem The Firebase Auth third-party guide shows Kotlin readers how to set `accessToken` on a supabase-kt client, but it doesn't say that the client then can't install the Auth plugin. A reader who adds `install(Auth)` gets an error when the client is created, and can't tell from the page that Supabase Auth sign-in methods aren't part of this setup. Related to [FDBKIN-7469](https://linear.app/supabase/issue/FDBKIN-7469/improve-documentation-for-using-firebase-jwts-with-supabase-auth) Closes [DOCS-1713](https://linear.app/supabase/issue/DOCS-1713) ## Solution The Kotlin (Android) and Kotlin (Multiplatform) tabs of the client setup section on `/docs/guides/auth/third-party/firebase-auth` now each end with the same short note: leave out the Auth plugin on a client that sets `accessToken`. A paragraph after the tabs covers every SDK: a client that sets `accessToken` can't use Supabase Auth methods, so users sign in and out with Firebase Auth on that client, and a second client without `accessToken` serves Supabase Auth when the app uses both. Each user's requests go through the client that matches how they signed in. The code samples and the TypeScript, Flutter, and Swift tabs are unchanged. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed file. All pass. The Kotlin note was checked against supabase-kt at commit `1ea6e8e`: the Auth plugin's `init` in `Auth/src/commonMain/kotlin/io/supabase/auth/AuthImpl.kt` (line 148) throws when the client has a custom access token provider. The paragraph after the tabs was checked against the `auth` accessor guards in supabase-js (`packages/core/supabase-js/src/SupabaseClient.ts`), supabase-flutter (`packages/supabase/lib/src/supabase_client.dart`), and supabase-swift (`Sources/Supabase/SupabaseClient.swift`, whose doc comment recommends a separate client without `accessToken` for Supabase Auth). The token each client sends was checked in the same files and in supabase-kt's `AccessToken.kt`: a client with `accessToken` sends that token, and a client without it sends its Supabase Auth session. The change adds no code, so there is nothing to run. Docs tests were skipped because they need Docker. ## How to verify 1. Open `/docs/guides/auth/third-party/firebase-auth` on the docs preview. 2. In the client setup tabs, select **Kotlin (Android)**: a note below the code sample says to leave out the Auth plugin (`install(Auth)`) on a client that sets `accessToken`. 3. Select **Kotlin (Multiplatform)**: the same note appears below its code sample. 4. Below the tabs, before "Add a new Third-Party Auth integration to your project", a paragraph says a client that sets `accessToken` can't use Supabase Auth methods, that users sign in and out with Firebase Auth on that client, that a second client without `accessToken` can use Supabase Auth, and that each user's requests go through the client that matches how they signed in. It shows whichever tab is selected. 5. The TypeScript, Flutter, and Swift tabs and all code samples match 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> |
||
|
|
95cf9a78a7 |
docs(cli): show config examples in TOML and JSONC (#53449)
## Problem The CLI reads `supabase/config.jsonc` (and `config.json`) since v3.1.0, but every docs page still shows `config.toml` only. There's also no page explaining the formats, how to switch, the `$schema` / `#:schema` declaration, or editor setup, and no reference pages for the new `supabase config convert` and `supabase config validate` commands. Linear: CLI-2871 ## Solution - **Dual-format examples from one source.** A new directive (`features/directives/ConfigFormats.ts`) picks up any ```` ```toml ```` fence with `name=supabase/config.toml` and renders it as `supabase/config.toml` / `supabase/config.jsonc` tabs. The JSONC is generated at build time with `convertCliConfigTomlToJsonc` from `@supabase/config`, the same converter `supabase config convert` uses, so authors only write TOML and the JSONC matches what the CLI would produce (comments included). Inside `<$CodeTabs>` the JSONC is added as an extra tab. - **The format choice sticks.** `ConfigCodeTabs` keeps the selected format in `localStorage`, so choosing JSONC switches every config example on the page and on later pages. - **Config reference.** The `usage` examples on `/guides/local-development/cli/config` use the same tabs (they were highlighted as Python before), and the intro mentions `config.jsonc`. The `remotes.<branch_name>` example now uses `[remotes.staging]`, since `<branch_name>` isn't a valid TOML key. - **New guide, "Config file formats"** (`/guides/local-development/cli/config-formats`): which file wins, minimum CLI version, `convert` and `validate`, schema declaration and versioning, and editor setup (VS Code trusted domains, Even Better TOML, Tombi, SchemaStore). - **CLI reference.** Adds `supabase-config-convert` and `supabase-config-validate` to the CLI reference nav. `cli_v1_commands.yaml` is the generated v3.2.0 reference, identical to the release bot's update in #53463, so the two PRs don't conflict. - **Content.** About 60 existing config examples across the guides, including the Branching configuration page, are tagged `name=supabase/config.toml`. Branching reads `config.json` and `config.jsonc` as well, and the Branching configuration page now says so. Non-Supabase TOML (`pyproject.toml`, `bunfig.toml`) and the v2-era `[inbucket]` before/after snippet stay TOML-only. - **Format-neutral prose.** Sentences that described the config as `config.toml` now say "your config file", naming `supabase/config.toml` and `supabase/config.jsonc` once per page. TOML section syntax in prose (`max_frequency` under `[auth.email]`) is written as key paths (`auth.email.max_frequency`), which read the same in both formats. Headings that named `config.toml` keep their old anchors. Sentences about what `supabase init` creates still say `config.toml`. - **Markdown export for agents.** `internals/generate-guides-markdown.ts` runs the same transform, so the `.md` pages served to AI agents include the JSONC example after each TOML one. - A test converts every tagged example under `content/`, so a broken TOML example fails tests instead of the build. New dependencies for `apps/docs`: `@supabase/config` (^1.8.0) and `effect` (the same `effect` version Studio pins). `config convert` and `config validate` ship in CLI v3.2.0, which is now stable. ## Review instructions 1. Open `/docs/guides/local-development/seeding-your-database` on the preview. Switch an example to `supabase/config.jsonc` and check the other examples on the page switch too. 2. Open `/docs/guides/local-development/cli/config` and check the usage examples open on JSONC. 3. Read `/docs/guides/local-development/cli/config-formats`. 4. Open `/docs/reference/cli/supabase-config-convert` and `/docs/reference/cli/supabase-config-validate`. ## Self-review Ran the `review-the-docs` local self-review (content, pipeline, and component checks) over the 54 changed pages. - No blockers. Fixed the nits it found: leftover TOML section syntax in prose (diff engines, declarative schemas, Branching, the common settings table on Local and hosted projects), a few long or ungrammatical sentences, and the conversion follow-up steps on Config file formats, now a list. - Links, custom anchors, nav wiring, and frontmatter check out. - The `.md` export on the preview shows each TOML example followed by its JSONC version. - `test-the-docs` deferred: the changed fences are config snippets, and `ConfigFormats.test.ts` already converts every tagged example. No procedural steps changed apart from the `config convert` and `config validate` commands on the new page. ## 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) |
||
|
|
00c96d23f0 |
docs(auth): update Keycloak client settings to the current admin console (#53638)
## Problem The Keycloak social sign-in guide still describes the legacy Keycloak admin console: it tells readers to set "Access Type" to "confidential", a field that no longer exists. The current console configures this under **Capability config** with **Client authentication** and **Standard flow**. Related to [FDBKIN-4596](https://linear.app/supabase/issue/FDBKIN-4596) Closes [DOCS-1684](https://linear.app/supabase/issue/DOCS-1684) ## Solution In `apps/docs/content/guides/auth/social-sign-in/auth-keycloak.mdx`: - **Overview list:** the client uses **Client type** **OpenID Connect**, with **Client authentication** and **Standard flow** on under **Capability config**. The secret bullet now says **Client Secret** on the **Credentials** tab. - **One client procedure:** merged "Create a Keycloak client" and "Client settings" into one numbered procedure that follows the Create client screens: 1. **Clients** > **Create client** 2. Set **Client type** to **OpenID Connect** 3. Set **Client ID**, then **Next** 4. In **Capability config**, turn on **Client authentication** and leave **Standard flow** on, then **Next** 5. In **Login settings**, add the callback URL to **Valid redirect URIs** 6. **Save** Each step is an instruction. The labels match the Keycloak tab of the self-hosted OAuth guide. The "Client settings" heading is gone, and nothing in the repo links to its anchor. - **Client secret:** "Obtain the client secret" says to copy the **Client Secret** from the client's **Credentials** tab. - **Screenshots:** removed every screenshot of the legacy console from the page and deleted the files under `apps/docs/public/img/guides/auth-keycloak/`, which nothing else references: - `keycloak-create-realm.png` - `keycloak-add-client.png` - `keycloak-client-id.png` - `keycloak-redirect-uri.png` - `keycloak-client-secret.png` - `keycloak-openid-endpoint-config.png` No new screenshots are added. Supabase Auth's Keycloak provider uses a confidential Authorization Code flow (client secret plus code exchange). That flow needs Client authentication and Standard flow, so the guide does not ask readers to enable Direct access grants. Unchanged: the `docker run` command and the text of the realm section. Checks: `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed MDX file all pass. The docs tests were skipped because they need Docker. ## 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> |
||
|
|
8feb4a04a4 |
fix(docs): correct OpenCode MCP config, Python type examples, and small docs gaps (#53637)
## Problem
Several docs snippets and statements are wrong or incomplete:
- The OpenCode MCP config generated by `McpUrlBuilder` uses the old
shape (`mcp.supabase` with `enabled: true`). Current OpenCode config
expects servers under `mcp.servers.<name>` and uses `disabled` instead
of `enabled`, so the snippet does not register the server.
- The Python type generation guide builds Pydantic models with
`PublicMovies(m)`. `BaseModel` does not accept a positional dict, so the
example raises `TypeError`.
- The API keys page does not mention that the Data API OpenAPI root
(`GET /rest/v1/`) accepts only secret keys, so a publishable key gets a
401 there.
- The logs page says retention depends on the plan but does not give the
values.
- The Auth Hooks page names the Send SMS hook secret
`SEND_SMS_HOOK_SECRETS`, while the Send SMS hook page, the other hook
pages, and the self-hosting guide use the singular `..._HOOK_SECRET`.
## Solution
- `packages/ui-patterns/src/McpUrlBuilder`: OpenCode config now emits `{
"mcp": { "servers": { "supabase": { "type": "remote", "url": ... } } }
}`. Updated `OpenCodeMcpConfig`, `isOpenCodeMcpConfig`, and `getMcpUrl`
to match.
- `generating-python-types.mdx`: use `PublicMovies.model_validate(m)` in
the select, insert, and update examples.
- `getting-started/api-keys.mdx`: add a Known limitations bullet about
`GET /rest/v1/` requiring a secret key, with table routes or
`/auth/v1/health` as the check for a publishable key.
- `observability/logs.mdx`: add a per-plan retention table (Free 1 day,
Pro 7 days, Team 28 days, Enterprise 90 days), matching
`packages/shared-data/pricing.ts`.
- `auth/auth-hooks.mdx`: rename `SEND_SMS_HOOK_SECRETS` to
`SEND_SMS_HOOK_SECRET`.
Checks run: `pnpm turbo run typecheck --filter='...[origin/master]'`
(passed, run with `--concurrency=1` after the first run was OOM-killed),
`pnpm turbo run lint --filter='[origin/master]'` (passed, no errors),
`vitest run src/McpUrlBuilder` in `packages/ui-patterns` (37 passed),
and Prettier on changed files. Docs tests were skipped because they need
Docker.
## Review instructions
1. On the docs preview, open `/docs/guides/getting-started/mcp`, select
OpenCode, and confirm the config shows `mcp.servers.supabase` with
`type: "remote"` and the URL, and no `enabled` field.
2. Open `/docs/guides/ai-tools/mcp`, select OpenCode, and confirm the
same config.
3. Open `/docs/guides/api/rest/generating-python-types` and confirm the
select, insert, and update examples use
`PublicMovies.model_validate(m)`.
4. Open `/docs/guides/getting-started/api-keys#known-limitations` and
confirm the bullet about `GET /rest/v1/` accepting only secret keys.
5. Open `/docs/guides/observability/logs` and confirm the retention
table lists Free 1 day, Pro 7 days, Team 28 days, Enterprise 90 days.
6. Open `/docs/guides/auth/auth-hooks` and confirm the Send SMS examples
use `SEND_SMS_HOOK_SECRET`, not `SEND_SMS_HOOK_SECRETS`.
## 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>
|
||
|
|
671c94e868 |
chore(docs,kb) - Update 301 destinations to final resolution + fix some 404s (#53553)
## Context Lots of links that initially go to 301's within docs / kb. Updates these to their resolved target. Ask your Claude Code to review the new destinations programmatically. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
ceae23e199 |
docs: add cross-links in guides (AI, API, Auth, Database, Functions, deployment) (#53560)
## What Adds internal cross-links to docs guides ## Testing - Prettier passes on the changed lines. - Docs build passes (`pnpm build --filter=docs`). - Docs link e2e run locally against the production build for every changed page across this PR --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
e20bf8829c |
chore(studio,docs,www) - update [YOUR-PASSWORD] to be [YOUR-DATABASE-PASSWORD] for semantics + subsequent search terms (#53531)
## Problem Flavor of #41370 , but we can see that at least some traffic for this search query is searching using phrases like `supabase password reset` and `supabase password` and then accidentally find themselves on the `/docs/guides/auth/passwords` page. You can see this through user flow mappings in PostHog + also in search query traffic in Google Search Console. <img width="1261" height="669" alt="image" src="https://github.com/user-attachments/assets/70af109c-dbc8-42c2-887a-63133f3f82d5" /> <img width="1128" height="669" alt="image" src="https://github.com/user-attachments/assets/52358d87-55a8-4491-ad26-a0d390ebe55b" /> ## Solution Renames the placeholder across docs / studio / www to `[YOUR-DATABASE-PASSWORD]` and adds an admonition to the current `/docs/guides/auth/passwords` to direct folks to the correct place. Might also be a UX fix in the dash.... but poking into it feel like we already have a lot of affordances there already (`Reset database password` button on the direct connection panel + quick search action for `Reset database password`). ## Preview links ### Studio `https://studio-staging-obj7agk56-supabase.vercel.app/dashboard/project/$PROJECT?showConnect=true&connectTab=direct` <img width="1128" height="801" alt="image" src="https://github.com/user-attachments/assets/420c8582-97bd-45ff-914e-ea9bb25aed91" /> ### Docs https://docs-git-kody-devrel-866-database-password-placeholder-supabase.vercel.app/docs/guides/auth/passwords <img width="838" height="463" alt="image" src="https://github.com/user-attachments/assets/c4bb0242-6ff7-4de7-90c7-386818649209" /> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
39cf54f3c4 |
docs: add cross-links to related guides and references (#53384)
## What Adds internal cross-links where a page mentions a product, feature, or concept that has its own canonical page. This PR covers docs guides under `apps/docs/content/guides`, excluding the shared partials (separate PR). ## How links were chosen - One canonical target per keyword, preferring docs guides over marketing or blog pages for docs content. - Only plain prose mentions: nothing inside headings, code, frontmatter, existing links, or UI labels. - One link per sentence, and no second link to the same target on a page. ## Testing - Prettier passes on all changed files. - Not yet run: docs build and internal link test, KB build. Draft until those are checked. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
80a8b3a7d2 |
docs: add cross-links in shared partials + fix broken links flagged by e2e (#53383)
## What Adds internal cross-links where a page mentions a product, feature, or concept that has its own canonical page. This PR covers the two shared docs partials, so each link appears once in source and propagates to every page that includes the partial (the social-login setup pages and the quickstarts). ## How links were chosen - One canonical target per keyword, preferring docs guides over marketing or blog pages for docs content. - Only plain prose mentions: nothing inside headings, code, frontmatter, existing links, or UI labels. - One link per sentence, and no second link to the same target on a page. ## Testing - Prettier passes on all changed files. - Not yet run: docs build and internal link test, KB build. Draft until those are checked. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
5ca501cd24 |
chore(docs) - Remove inline Accordion component for machine readability -> details/summary instead (#53274)
## Problem Accordion components -- as currently constructed -- aren't machine readable b/c they require JS. Additionally, they aren't heavily used at all. ## Solution Removes accordion component from codebase + moves existing usage into `<details>` / `<summary>` components. Adds some default styling for the new HTML pattern so they look similar. Could also refactor accordion to auto-template out details/summary too. No strong pref here. ## Limits The sidebar navigation accordions use radix-ui directly and are unchanged. ## Preview links ### Before [Creating a client (before)](https://supabase.com/docs/guides/auth/server-side/creating-a-client#nextjs-utility-functions) https://github.com/user-attachments/assets/fd320358-7a35-46f8-b7b4-177b023e748e ### After [Creating a client (before)](https://docs-git-kody-devrel-850-remove-accordions-docs-mdx-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client#nextjs-utility-functions) https://github.com/user-attachments/assets/22049184-9157-46d2-a3a6-64ca2c991e24 --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
38f9bac61f |
fix(docs): express ssr client cookie (#53179)
## Problem - the express server client in the ssr "creating a client" guide calls `serializeCookieHeader(name, value)` without `options` - the auth cookies then have no `path` and no `maxAge`, so the browser limits them to the request path and drops them when the browser closes ## Solution - adds the cookie `options` to `serializeCookieHeader` in the express `setAll`, so the auth cookies keep the settings from `@supabase/ssr` - changes the express sample to match the other server samples on the page <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> ## Additional context - found that issue while i ran the docs agent feedback evals ## Review instructions 1. visit [/docs/guides/auth/server-side/creating-a-client#express-create-clients](https://docs-git-antlio-fix-docs-express-cookie-options-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client#express-create-clients) and select the express tab 2. make sure that the preview `setAll` in `lib/supabase.js` reads `({ name, value, options })` and passes `options` to `serializeCookieHeader` ## 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) |
||
|
|
701730e3eb |
chore(kb,www,docs) - Add in relevant cross-links between the Supabase Component Library and kb,www,docs (#53237)
## Problem After #53183 and #52567 have been addressed, we should strengthen the interconnections between the UI library and the rest of the Supabase ecosystem. ## Solution - Adds contextual links for `/library`, Auth / Realtime category pages, and specific Auth / Realtime components. Hits top-level product pages, docs, kb, and blogs. ## Preview links N/A, link changes are relatively atomic so easier to review without many preview links. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
396358c7cb |
chore(docs,www) - added, deleted, redirected URLs (#53097)
## Problem added, deleted, redirected URLs + urls for new blog posts ## Preview links N/A --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
ab54becc60 |
docs(storage): move url signing keys to dedicated page (#52954)
## Problem Details about URL signing keys are embedded in the downloads page, but it is a broader security related topic that applies to both uploads and downloads. There is no signed URL guidance in the Standard Upload section ## Solution - Move details about URL signing keys to a dedicated page under the storage>security tab (content mostly the same) - Replace URL signing key details in downloads page with a brief blurb and a link (keep header in case it has been hot linked) - Add link to URL signing key details to resumable upload > signed url section - Add signed URL details to standard upload page, and similarly link to url signing key page - Update link in URL signing key page of dashboard to point to new dedicated URL Signing key page ## Additional context Follow up to: https://github.com/supabase/supabase/pull/52522 --------- Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
6891fc4cc6 |
docs: cross-link RLS and signing keys to the pages readers look for (#52670)
## I have read the CONTRIBUTING.md file. YES ## What kind of change does this PR introduce? **Docs fix: three missing or buried cross-links.** Readers who need Securing your API, custom claims and role-based access control, or the API key migration guide land on Row Level Security or Signing keys and stop there, because those pages do not point clearly to the page they need. This PR adds a tip near the top of Row Level Security, one link in its `auth.jwt()` section, and two links on Signing keys. It changes links and one sentence each, nothing else. Closes DOCS-1572. ## What is the current behavior? - Linear item: Cross-link RLS and signing keys to the pages readers are looking for - The IA scoring v2 comparison on the live site (2026-11-01) found three findability tasks that fail under both the production nav and Option 1. A nav change does not fix them. | Agent lands on | Should reach | Runs that miss (production / Option 1) | | --- | --- | --- | | Row Level Security | Custom claims and RBAC | 9 / 9 of 10 | | Row Level Security | Securing your API | 10 / 10 of 10 | | Signing keys | Migrating to new API keys | 9 / 9 of 10 | - Row Level Security already links to Securing your API in passing and in its related list, but not where a reader decides to stay or leave. ## What is the new behavior? | File | Change | | --- | --- | | `guides/database/postgres/row-level-security.mdx` | Tip after the opening admonition, with "refer to": Securing your API for what the Data API exposes, Custom claims and RBAC for role-based policies. One more RBAC link in the `auth.jwt()` section. | | `guides/auth/signing-keys.mdx` | Link to Migrating to new API keys in the intro and in the step that tells readers to switch to publishable and secret keys. | ## Additional context - Worktree: `~/GitHub/supabase/supabase-worktrees/nikrichers/docs-1572-cross-link-rls-and-signing-keys-to-the-pages-readers-are` - The `<Admonition type="tip">` matches the admonition syntax already on the page. | Check | Result | | --- | --- | | Target pages exist | Pass, all three | | Prettier, stand-in check on both files | Pass | | Repo `pnpm run format` | Not run locally: `pnpm install` needs Node 22.23.4 or later. CI runs it. | ### Before & After | Page | Before (production) | After (preview) | | --- | --- | --- | | Row Level Security | [production](https://supabase.com/docs/guides/database/postgres/row-level-security) | [preview](https://docs-git-nikrichers-docs-1572-cross-link-rls-an-d0b526-supabase.vercel.app/docs/guides/database/postgres/row-level-security) | | Signing keys | [production](https://supabase.com/docs/guides/auth/signing-keys) | [preview](https://docs-git-nikrichers-docs-1572-cross-link-rls-an-d0b526-supabase.vercel.app/docs/guides/auth/signing-keys) | Both preview pages return 200 and contain the new links. ### Test plan - [ ] Row Level Security shows the tip near the top, and both links open the right pages. - [ ] The `auth.jwt()` section links to Custom claims and RBAC. - [ ] Signing keys links to Migrating to new API keys in the intro and in the switch step. - [ ] After merge: rerun the three affected IA scoring tasks on production, 10 runs each. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Nik Richers <nik@validmind.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1d50816f47 |
docs: enforce duplicate ID a11y rules and fix duplicates (#52720)
Closes DOCS-1573 ## Problem Recently, @antlio surfaced that our side nav was visually breaking. This is caused by a duplicate-id issue. The docs E2E axe scan reports duplicate `id` attributes as a warning only, so pages with duplicate IDs ship. A full scan of production guides found duplicate IDs on 25 of 586 pages. **Causes:** - **Repeated headings:** a page uses the same heading text twice, for example `#### Example` under two sections. Each heading slugs to the same ID. - **Pricing partials:** three usage pages put `## Pricing` directly above a shared partial that starts with its own Pricing heading. - **Components:** Mermaid diagrams hardcode SVG marker and node IDs. The Apple secret generator renders `id="undefined-optional"` on each field label. Each "Build it" listing on the Supabase way page renders `#build-it`. ## Solution - **Enforce the rules:** add `duplicate-id`, `duplicate-id-active`, and `duplicate-id-aria` to `ENFORCED_RULES`. - **Repeated headings:** give each later duplicate a `[#parent-section-heading]` anchor. The first occurrence keeps its ID. - **Pricing headings:** remove the page heading above the three partials that start with `## Pricing`. The PITR partial starts with `### Pricing`, so it gets `[#pitr-pricing]` and the page keeps its H2. - **Mermaid:** prefix the SVG IDs of each diagram with `useId()`. - **Apple secret generator:** give each field an ID. The label now also points at its input. - **Content listings:** add an optional `headingAnchor` to listing groups, and set it on the repeated "Build it" groups. - **pg_net:** the `http_delete` signature had `[#post-signature]`, copied from `http_post`. It is now `[#delete-signature]`. **Cross-references:** no link in the repo targets a changed ID. Each first occurrence keeps its ID, so existing links resolve to the same heading as before. **Not changed:** the www suite and `packages/ui-patterns`. All fixes stay in `apps/docs`. **Verification:** - Against production, `/docs/guides/platform/manage-your-usage/log-drains` fails the @a11y test with `duplicate-id`. - Against a local docs server, the @a11y test passes on all 28 changed or affected pages. **Unverified:** a full-site run with `A11Y_ENFORCE_ALL=1`. Run it against the preview before merge. ## Review instructions 1. From `e2e/docs`, run the a11y test against production. See it fail with `duplicate-id`: ```bash DOCS_E2E_PAGE_PATHS=/docs/guides/platform/manage-your-usage/log-drains PLAYWRIGHT_BASE_URL=https://supabase.com pnpm exec playwright test --grep @a11y ``` 2. Run the same command with `PLAYWRIGHT_BASE_URL` set to the docs preview URL from the Vercel bot comment. See it pass. 3. On the preview, open `/docs/guides/platform/manage-your-usage/log-drains`. In the table of contents, select **Pricing** under **Log Drain Events**. See the page scroll to the second Pricing section. 4. On the preview, open `/docs/guides/integrations/partner-integration-guide`. See both sequence diagrams render with arrowheads. ## 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) |
||
|
|
86848fc036 |
docs: move the production security checklist to its own page (#52466)
Closes DOCS-1494 ## Problem The Security section of the Production checklist is split out as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). ## Solution - **Structure:** move `## Security` to `guides/security/production-checklist`. The production checklist keeps the heading, and its `#security` anchor, with a one-sentence pointer. The page is in the Security sidebar under Guides, after Production Checklist. - **Option 1 navigation:** the "Production security checklist" entry in Run and manage, Security and compliance, points to the new page. The Option 1 test no longer expects the anchor. - **Page shape:** a value-statement opener with the situations that call for the checklist, then the items grouped under Database, Account and organization, Auth, and Threat review. Each group opens with a lead-in that says what its checks protect. - **Inbound links:** two Studio linter entries for OTP settings, the Studio Auth providers form, and `auth/auth-email-passwordless` now point to `production-checklist#auth`. The password length lint points to the password security guide instead, since the checklist has no password item. They used to land on `going-into-prod#security`, which is a pointer now. - **Claim fixes:** - The replication item told readers to enable replication on sensitive tables. It now says to enable RLS on replicated tables that hold sensitive data. - The Auth items named **Authentication > Providers**. The Dashboard label is **Sign In / Providers**. - **Terminal path:** the Auth group links the Management API endpoint for its settings. The Database items link to guides that carry CLI or SQL paths. - **Review fixes:** a note that RLS doesn't filter Postgres Changes `DELETE` events, a SQL path for publications, and the other email links the OTP expiry controls. - **Agent prompt:** after the opener, a copyable `AiPrompt` that has an agent audit the project read-only and report each item as pass, fail, or can't check. It reads Security Advisor and the tables through the Supabase MCP server, and SSL, network restrictions, Auth settings, and org members through Management API GET endpoints. `includeInMarkdown` is on, so the `.md` carries the prompt as a fenced text block. - **Cross-links:** Testing auth flows points to the checklist's Auth group, and the Security overview and Product configuration pages link the checklist. The custom SMTP item links the SMTP guide. ### Not verified - **Deferred samples:** none. The page has no code samples. - **Agent prompt:** its endpoints and fields match `api_v1_openapi.json`, and `Owner` matches Studio's role name. No agent has run it against a hosted project. - **Studio:** the link changes are strings only. Studio tests and build run on this PR because it touches `apps/studio`. ## Manual testing 1. Open [Production security checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/security/production-checklist). See the agent prompt below the opener and four groups of checks. Click **Copy** and see the prompt text. 2. Open [Production checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/deployment/going-into-prod#security). See the Security heading with a one-sentence pointer to the new page. 3. In the Security sidebar under Guides, click **Production security checklist**. See the new page open. |
||
|
|
d97a410577 |
docs: add a Supabase CLI v2 to v3 migration guide (#52147)
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Docs update ## What is the current behavior? There's no page covering the breaking changes between Supabase CLI v2 and v3. v3.0.0 was released on 2026-11-02. ## What is the new behavior? Adds a migration guide at `/docs/guides/local-development/cli/migrating-to-v3`, linked from the Local Dev / CLI nav just under "Install and run the CLI". It's modelled on [Vite's migration guide](https://vite.dev/guide/migration): a short summary, what to do before upgrading, how to install (or stay on v2), a CI quick-reference table, then one section per change, ending with the removed commands, flags, config keys and env vars as tables. The content comes from the `BREAKING CHANGE` footers of the breaking PRs on supabase/cli `next`, checked against the code there: supabase/cli#6609, supabase/cli#7064, supabase/cli#7066, supabase/cli#7074, supabase/cli#7109, supabase/cli#7116, supabase/cli#7172, supabase/cli#7176, supabase/cli#7188 and supabase/cli#7221. ## Additional context The page describes v3.0.0 as released: npm `latest`, Homebrew, Scoop and the Linux packages all install v3. The "Staying on v2" channels are live with v2.122.1: npm `v2.stable`, `supabase/tap/supabase@2`, `supabase-v2-stable` on Scoop, and `version: v2.stable` or a semver range like `^2` on `supabase/setup-cli@v3` (ranges need v3.2.0). It also updates about 60 existing guides and troubleshooting pages for v3. Hosted examples pass `--remote`, CI examples that change a hosted project pass `--yes`, deprecated target flags and removed commands are replaced, and pages that described migra as the default now describe pg-delta. It adds a new concept page, "Running commands against local and hosted projects" at `/docs/guides/local-development/local-and-hosted-projects`, linked from the Local Dev nav after "Local development workflow". It covers how a command picks its target (local by default, `--remote` and its forms, the linked project, the `Target:` line), how settings resolve (flag, then shell env, then project env files, then config), and when the CLI asks before changing a hosted project (`--yes`, `SUPABASE_YES`, `--dry-run`, seeding), with a CI recipe and a section for AI coding agents. The migration guide links to it from its target, consent and config sections. Tracks CLI-2747 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
63ea299a2b |
docs(auth): clarify ip_address is not included in audit logs (#43005)
Fixes #42997 Removed `ip_address` from the audit log example and clarified that client IP addresses are stored in `auth.sessions`, but are not currently included in Auth audit logs. This aligns the documentation with the current behavior. --- ## I have read the CONTRIBUTING.md file. YES ## What kind of change does this PR introduce? Docs update ## What is the current behavior? The documentation example includes `ip_address` in Auth audit logs, but this field is not actually present in the audit logs. ## What is the new behavior? The example no longer includes `ip_address`, and a note clarifies that IP addresses are stored in `auth.sessions`, but not included in audit logs. ## Additional context N/A --------- Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Nik Richers <nrichers@gmail.com> Co-authored-by: Nik Richers <nik@validmind.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a19cfc54eb |
fix(docs): use string for smtp_port in custom SMTP example (#52418)
## Problem
The custom SMTP Management API example in the Auth documentation sends
`smtp_port` as a number (`587`). The API expects a string and rejects
the numeric value with:
```json
{"message":"smtp_port: Invalid input, expected string, received number"}
```
Fixes #52384.
## Solution
Change `smtp_port` from `587` to `"587"` in the `curl` example in
`apps/docs/content/guides/auth/auth-smtp.mdx`, matching the API's
expected string type.
## Review instructions
1. Open `apps/docs/content/guides/auth/auth-smtp.mdx`.
2. Find the custom SMTP Management API example.
3. Verify that `smtp_port` is `"587"` and that the rest of the example
remains unchanged.
## Validation
- `git diff --check` — passed.
- JSON payload parsing — passed; `smtp_port` is a string.
- Prettier check for the modified MDX file — passed.
- Full monorepo build — not run; this is a one-line documentation
change.
- Live API snippet test — deferred because it would target the
production Management API.
## Checklist
- [x] I have read
[[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md).
- [ ] If I edited an existing docs topic, I used the `/edit-the-docs`
skill, which applies the docs [[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide).
Co-authored-by: Nik Richers <nrichers@gmail.com>
|
||
|
|
28d9157aab |
docs: stop guide subtitles from repeating the first sentence (#52568)
Closes DOCS-1553 ## Problem Some guides set a subtitle that says almost exactly what the first sentence of the page says, so the reader reads the same line twice. ## Solution - Add a **Write good frontmatter** section to the style guide, with **Title**, **Subtitle**, and **Description** subsections. A title is 35 characters or fewer, in sentence case, and follows the Google developer style guide's title rules. A subtitle is optional and decorative. If it matches the first sentence, leave it out. A description is 150–160 characters, with relevant keywords. - Remove the subtitle on 12 guides where it repeated the first sentence. On the 6 of those with no description, move the subtitle to `description` so the meta description doesn't change. - Change the Vault subtitle to `Manage secrets in Postgres` to match the rule's example. - In `CONTRIBUTING.md`, mark `description` as required and link to the new section. ## Manual testing 1. Open [Creating a client](https://docs-git-docs-guide-subtitles-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client). See no subtitle under the title. 2. Open [Vault](https://docs-git-docs-guide-subtitles-supabase.vercel.app/docs/guides/database/vault). See `Manage secrets in Postgres` under the title. 3. Read [Write good frontmatter](https://github.com/supabase/supabase/blob/docs/guide-subtitles/apps/docs/style-guide/03-page-structure.md#write-good-frontmatter). |
||
|
|
340101642a |
docs: move preview branches on Vercel to its own page (#52473)
Closes DOCS-1497 ## Problem The Vercel section of Branching integrations is split out as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). ## Solution Split out the old section into a new one with `/edit-the-docs` and `/test-the-docs`. ## Manual testing 1. Open [Preview branches on Vercel](https://docs-git-docs-vercel-preview-branches-supabase.vercel.app/docs/guides/integrations/vercel-preview-branches). See the prerequisites, two steps, and the After you connect section. 2. Open [Branching integrations](https://docs-git-docs-vercel-preview-branches-supabase.vercel.app/docs/guides/deployment/branching/integrations). Under **Hosting providers**, see a one-sentence pointer to the new page, with no Vercel heading. 3. In the Branching sidebar, click **Preview branches on Vercel**. See the new page open. 4. In the Integrations sidebar, click **Preview branches on Vercel**, after **Vercel Marketplace**. See the new page open with the Integrations sidebar. |
||
|
|
804a3c0969 |
chore(docs) - add in unique titles where appropriate (#52452)
## Problem Dupe titles in docs. ## Solution Adds unique titles where appropriate + high confidence. ## Preview links | Before | After | |---|---| | [Database Migrations \| Supabase Docs](https://supabase.com/docs/guides/deployment/database-migrations) | [Deploy Database Migrations \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/deployment/database-migrations) | | [Database Migrations \| Supabase Docs](https://supabase.com/docs/guides/local-development/database-migrations) | [Local Database Migrations \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/local-development/database-migrations) | | [Limits \| Supabase Docs](https://supabase.com/docs/guides/storage/uploads/file-limits) | [Storage Upload Limits \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/storage/uploads/file-limits) | | [Limits \| Supabase Docs](https://supabase.com/docs/guides/functions/limits) | [Edge Functions Limits \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/functions/limits) | | [Error Codes \| Supabase Docs](https://supabase.com/docs/guides/storage/debugging/error-codes) | [Storage Error Codes \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/storage/debugging/error-codes) | | [Views \| Supabase Docs](https://supabase.com/docs/guides/database/views) | [Database Views \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/database/views) | | [Self-Hosting \| Supabase Docs](https://supabase.com/docs/reference/self-hosting-auth/introduction) | [Self-Hosting Auth \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/reference/self-hosting-auth/introduction) | | [Supabase Docs](https://supabase.com/docs/reference) | [Supabase API references ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/reference) | --------- Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com> |
||
|
|
ec11e10d35 |
chore(docs) -- add in relevant crosslinks over to /kb troubleshooting pages (#52503)
## Problem relevant cross-links missing to KB articles. ## Solution Claude pass with an attempt to inline these where possible. Some were a new sentence, but spot check felt like they were mostly appropriate. ## Preview links N/A b/c too many atomic changes to help that much. --------- Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> |