mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
create-pull-request/patch
22196
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2fcbeb10ff |
Update billing-faq.mdx (#54125)
## Problem The documentation does not make it clear that the support team cannot extend grace periods or make exceptions to applied restrictions. This may lead to incorrect expectations about what support can do. ## Solution Added a note to the documentation: > The support team cannot extend grace periods or make exceptions to applied restrictions. ## Review instructions 1. Open the changed documentation page. 2. Confirm the note is displayed in the appropriate context and clearly communicates the restriction. ## Checklist - [ ] 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). |
||
|
|
44f50c6cc1 | docs(self-hosted): include imgproxy in the macOS Storage volume fix (#53004) | ||
|
|
41013650d7 |
feat(studio): add disk right-sizing note to Disk settings (#54078)
## Problem Upgrade right-sizes the disk to 1.2x the database size (minimum 8 GB). This was only explained in the docs. Closes FE-5006 ## Solution Adds a short note to the Disk size field under Infrastructure settings, with a link to the docs section on reducing disk size. <img width="2358" height="938" alt="CleanShot 2026-11-25 at 8 38 47 PM@2x" src="https://github.com/user-attachments/assets/9cbe72db-9de3-4d5c-9064-5265b626f6be" /> - The note shows only when the saved disk size is larger than 8 GB, since a disk at the 8 GB minimum can't be right-sized any smaller. - It is hidden while the project is new or when disk data fails to load, so it never appears next to an error message. - The size check lives in a small helper, `canRightSizeDisk`, with unit tests. ## Review instructions 1. Open a project with a disk larger than 8 GB, then go to Settings > Infrastructure > Disk size. 2. Confirm the note appears under "Your plan includes up to X GB…" and that "Learn more" opens the "Reducing disk size" section of the docs. 3. Open a project with an 8 GB disk and confirm the note does not appear. |
||
|
|
433d95afd0 |
feat(studio): track usage on the API keys pages (#54070)
## Problem Nothing is tracked on the API keys pages (new and legacy), so we can't tell which keys people copy, how often they create or delete keys, or how quickly projects disable legacy keys. Closes FE-5030. ## Solution Adds five events, defined in `packages/common/telemetry-constants.ts` and fired through `useTrack()`: | Event | When | Properties | | --- | --- | --- | | `api_key_copied` | User copies a publishable, secret, or legacy anon/service_role key with its Copy button. Keyboard copies aren't counted. Not fired when blocked by permissions or when the copy fails. | `keyType` | | `api_key_reveal_clicked` | User reveals a secret or legacy service_role key (not on hide) | `keyType` | | `api_key_created` | Key created from the dialog, or by the first-time setup (fires once per key) | `keyType`, `source` | | `api_key_removed` | Key deleted after confirming in the modal | `keyType` | | `legacy_api_keys_updated` | Legacy keys disabled or re-enabled | `enabled` | - Create, delete, and legacy toggle fire in the mutation hook's `onSuccess`, so failed attempts aren't counted and the event still fires if the component unmounts mid-request. They're attributed to the mutation's own project. Copy and reveal fire in the click handler. - Delete is tracked in `SecretAPIKeys` / `PublishableAPIKeys`, where the confirm modal and mutation live, not in the dropdown item. - No key names or values in properties. - `data-attr` added to the copy, reveal, create, delete, and docs controls (static strings; Studio's PostHog autocapture is currently off, so these send nothing today). `DocsButton` gets an optional `data-attr` prop. - `ui-patterns` `Input` gets optional `onReveal` and `onCopied` callbacks. `onCopied` fires only for the Copy button, so legacy and new keys count copies the same way. - The empty-state sample keys are `inert`, so their buttons don't copy or track. - New `getLegacyApiKeyType` helper maps the legacy `anon` / `service_role` tags to the event's `keyType`. Tests cover copy, reveal, the no-event-on-hide and denied-grant cases, the legacy toggle, and the key-type helper. Success paths for the create dialogs and delete aren't covered. ## How to test - [ ] Open `/project/[ref]/settings/api-keys`, copy a publishable and a secret key, reveal a secret key, and check `api_key_copied` and `api_key_reveal_clicked` in PostHog (staging) with the expected `keyType` - [ ] Create and delete a publishable and a secret key and check `api_key_created` / `api_key_removed` - [ ] On the legacy page, copy anon and service_role, reveal service_role, then disable and re-enable the keys and check `legacy_api_keys_updated` |
||
|
|
dd1badd5b3 | docs(functions): trim self-hosted worker lifecycle section and fix isolate reuse claims (#54013) | ||
|
|
5be1d76ba7 | docs(self-hosted): correct NameID, claims, and rate limit details in the SAML guide (#54065) | ||
|
|
49525599d1 | docs(self-hosted): enable RLS on user_roles in the auth hooks guide (#54063) | ||
|
|
e0beeba832 | fix(docs): keep the home prompt panel text inside on phones (#54122) | ||
|
|
6062d5f44c |
chore: update cli reference doc (#53957)
Updates the CLI reference from the supabase/cli release workflow. The command spec and sidebar are generated from the same CLI command tree. For changes, edit the command tree or the content under `apps/cli/docs/` in supabase/cli. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
||
|
|
9a25d270f4 |
docs(legal): Privacy Policy v6 (telemetry cookies, California opt-out, subprocessors) (#54090)
<!-- claude-slack-attribution --> _Requested by **Drew McLellan**, **Ali Waseem** · [Slack thread](https://supabase.slack.com/archives/C0161K73J1J/p1795452919979329?thread_ts=1795452919.979329&cid=C0161K73J1J)_ ## Problem **Before:** The latest Privacy Policy is Version 5 (effective November 2, 2026). Its cookie table has no entries for the extra PostHog telemetry (session replay), Usercentrics, ConfigCat, Stape, Vercel or LinkedIn, and it lists Fly.io and Tableau as recipients. ## Solution **After:** Adds Privacy Policy Version 6 as `apps/www/data/legal/privacy/v6.mdx` (a copy of v5 plus the changes below) and registers it first in the `versions` list in `apps/www/pages/privacy.tsx`, effective **November 25, 2026** (confirmed by Legal). v1 to v5 stay available in the version switcher. This publishes Legal's updated policy (Sofia Calado, "Supabase Privacy Policy version Nov 25, 2026.docx") so the policy text covers the extra PostHog telemetry the team needs to collect. **How:** Changes applied from the docx (tracked changes plus two untracked edits; the chapter 3 opt-out edit was withdrawn by Legal), wording kept as written by Legal: 1. Intro: removed the duplicated `"personal information",`. 2. California bullet: the "You can manage your preferences" sentence is replaced by a new paragraph on "sale"/"sharing" with advertising partners, the opt-out route (Privacy Settings or privacy@supabase.com) and Global Privacy Control. 3. User Content: "AI-powered support tools" becomes "AI-powered services". 4. EEA recipients tables: removed Fly.io (5 tables) and Tableau (3 tables) from the service provider lists; "we may share..." in the law enforcement row now starts with a capital W. 5. Cookie table (chapter 8): new rows Usercentrics, Vercel (untracked in the docx, Legal comment: "This is also a new line."), ConfigCat, Supabase (replaces `_sb_first_referrer`), Stape, PostHog session replay (30 days) and LinkedIn; YouTube moved from Strictly necessary to Functional; Cloudflare cookie names added (`_cf_bm`, `__cflb`); Stripe purpose reworded to "To detect and prevent..." on all three rows; Google Analytics 4 and Google Ads purposes and cookie names updated; "Google ads" replaces "one of our ads". 6. Text after the table: adds "We use Functional cookies to help the Site work more smoothly and consistently." and drops "and, where applicable, to deliver personalized ads" (an untracked edit in the docx). Skipped as docx export artifacts: the "Supabase Pte. Ltd. | Source" header line, "Contents" list wording, "(at the end of this document)" instead of the anchor link, heading capitalization/trailing period, whitespace-only tracked edits ("available here"), curly quotes. Typo fixed: the docx drops the space in "prevent fraudulent" and in `"personal information" or`. Chapter 3 (Modifying Account Information) is unchanged from v5 per Legal: the consent sentence about sharing data with third-party partners for AI-powered services stays as it was, so the redline's opt-out wording is not applied. Confirmed by Legal: the effective date. The Usercentrics, ConfigCat, Stape and LinkedIn cells are linked to the vendor policies Legal supplied; the Supabase row's "This Privacy Policy applies" intentionally has no extra link (it refers to this policy). Cloudflare cookie name corrected to `__cflb` (the docx had a stray space; confirmed by Legal). The third Stripe row (2 years) was also reworded to "To detect and prevent fraudulent payments and transactions." to match the other two (confirmed by Legal). Nothing is left unconfirmed. ## Review instructions 1. Diff `apps/www/data/legal/privacy/v6.mdx` against `v5.mdx` (ignore table column padding from the formatter) and check it matches the list above. 2. Check `apps/www/pages/privacy.tsx` lists Version 6 first with November 25, 2026. 3. Open the Vercel preview of `/privacy` and confirm v6 renders (California bullet, cookie table) and the switcher still shows v5 to v1. I could not open previews from the agent session. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] N/A: no docs topic written or edited (legal page content only) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VBvtQX8X7t7w71qMkTvoXp --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
ecd959157a |
feat(www): serve Builder Day at supabase.com/builderday (#54113)
## Problem
We're building the site for Supabase Builder Day: 14 cities, one day, 10
December. It's its own Next.js app on Vercel (on the Supabase team) and
right now it only lives at `builderday.vercel.app`.
We want it at **supabase.com/builderday** so the links on the Luma pages
and in our emails point at a Supabase address, and so builders can sign
in with the Supabase account they already have instead of making a new
one.
## Solution
- `zoneRewrites('/builderday', ...)` in `apps/www/lib/rewrites.js`, the
same way `/library` and `/design-system` are served, so RSC prefetches
go through too.
- The app runs with `basePath: '/builderday'`, so its `/_next` assets
and `/api` routes stay under the prefix and don't collide with www's.
- `/builder-day` redirects to `/builderday`.
- A test next to the InstantDB one in `next.config.test.ts`.
**Depends on:** supabase/Builderday#5, which adds the base path on our
side. Until that's merged, `/builderday` returns 404.
## Review instructions
1. `cd apps/www && pnpm vitest run next.config.test.ts`
2. Once supabase/Builderday#5 is live, open `/builderday` on the www
preview: the Builder Day page loads, with no 404s for `/_next` or `/api`
in the network tab.
3. `/builder-day` redirects to `/builderday`.
4. `/dashboard`, `/docs` and `/library` still work.
## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
|
||
|
|
cbae30a467 |
feat(studio): link plan badge to upgrade flow (GROWTH-775) (#47447)
## What Makes the **Free** plan badge next to the organization name (in the org dropdown) a clickable entry point into the upgrade funnel. Resolves [GROWTH-775](https://linear.app/supabase/issue/GROWTH-775). Feedback verbatim: _"if i hit the 'free' button next to my account name it should take you to the upgrade to paid account funnel."_ The badge links to `/org/{slug}/billing?panel=subscriptionPlan&source=org_plan_badge`. Clicking it fires `upgrade_cta_clicked` with `placement: 'org_plan_badge'`. ## Changes | File | Change | |---|---| | `apps/studio/components/layouts/AppLayout/OrganizationDropdown.tsx` | Eligibility check and the linked badge. | | `apps/studio/components/layouts/AppLayout/AppLayoutDropdown.tsx` | New optional `trailingContent` slot, rendered as a sibling of the nav `<Link>`. Needed because a clickable badge can't be a `<Link>` nested inside the org `<Link>` (invalid HTML). Non-breaking — `BranchDropdown` is unaffected. | | `packages/common/telemetry-constants.ts` | Adds the `org_plan_badge` placement to `upgrade_cta_clicked`. | | `apps/studio/components/layouts/AppLayout/OrganizationDropdown.test.tsx` | Free org gets the link; partner-managed, billing-partner, and paid orgs keep the plain badge. | ## Who sees the link Orgs on the Free plan, managed by Supabase, with no `billing_partner`. Everyone else keeps the plain, non-clickable badge. The badge also stays plain when billing is disabled (`billing:all`) or plan changes are paused (`disableProjectCreationAndUpdate`), the same two checks `UpgradePlanButton` applies. Partner-managed orgs are excluded because they change plans at the partner (Vercel / AWS Marketplace / Stripe Projects). `PlanUpdateSidePanel` shows a `PartnerManagedResource` notice and disables every paid tier for them, so the badge would land them on a panel with no enabled action. `billing_partner` is checked separately because `getManagedByFromOrganizationPartner` doesn't map every partner — `fly` falls through to `supabase`. Free-plan members without `BILLING_WRITE` still get the link: `PlanUpdateSidePanel` renders `RequestUpgradeToBillingOwners` per plan card for them, so the landing is a real next action, not a dead end. ## Testing `OrganizationDropdown.test.tsx` covers the linked badge for a Free Supabase-managed org and the plain badge for partner-managed, billing-partner, and Pro orgs, plus the billing-disabled and plan-changes-paused cases. Existing partner-icon tests still pass. `tsc --noEmit` and Prettier are clean for the touched files. The Studio lint ratchet passes locally. --------- Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com> |
||
|
|
953e508a3e |
[FE-5110] refactor(studio): replace next/navigation with TanStack (#54041)
Moves the remaining `next/navigation` imports in Studio onto TanStack
Router hooks (and `useParams` from `common`), finishes migrating the
remaining `next/link` and `next/router` usages in the touched
components, and removes the `compat/next/navigation.ts` shim and its
Vite alias. Shared packages (`packages/**`) no longer import
`next/navigation`, so the alias can be dropped now.
**Removed:**
- `apps/studio/compat/next/navigation.ts` and the `'next/navigation'`
entry in `apps/studio/vite.config.ts`
- Global `next/navigation` mock in `apps/studio/tests/vitestSetup.ts`
and the obsolete `apps/studio/tests/lib/route-mock.test.tsx`
**Changed:**
- Replaced `usePathname` (12 files) and `useSearchParams` (3 files) with
`useLocation({ select })` from `@tanstack/react-router`
- Replaced `useRouter` in Storage bucket tables, SQL Editor commands,
and `SignInMfaForm` with `useNavigate` from `@tanstack/react-router`,
and updated `createNavigationHandler` in `lib/navigation.ts` to accept
either `NextRouter` or TanStack's `useNavigate`
- Replaced remaining `next/link` imports in touched components
(`SignInMfaForm`, `Restriction`, `DownloadLogsButton`,
`DownloadResultsButton`, `AuthEmailsLayout`, `AuthProvidersLayout`,
`JWTKeysLayout`, `StorageBucketsLayout`) with TanStack Router's `Link`
- Replaced `useParams` in `CreatePublishableAPIKeyDialog` with
`useParams` from `common` (matching `CreateSecretAPIKeyDialog`)
- Wrapped `CustomWrapper` (`tests/lib/custom-render.tsx`) in a default
TanStack `RouterContextProvider` (with optional `router` / `initialUrl`
overrides) and updated affected component tests to drop their
`next/navigation` mocks
Addresses
[FE-5110](https://linear.app/supabase/issue/FE-5110/replace-the-nextnavigation-shim-with-tanstack-router-hooks)
## To test
1. Check active tab highlighting and navigation across Auth Emails, Auth
Providers, JWT Keys, Storage Buckets, and Editor layouts
2. Verify clicking, Cmd/Ctrl-clicking, middle-clicking, and pressing
Enter on Storage bucket rows (Files, Analytics, Vector) navigates as
before
3. Run "Query a table..." and open SQL snippets from the Command Menu
and confirm `/project/$ref/sql/$id` opens with multi-line SQL preserved
in `?content=`
4. In the MFA sign-in flow, verify the recovery code link and
`forgot-password` completion preserve query params (`returnTo`,
`context=forgot-password`), and Cancel signs out and replaces history
with `/sign-in`
5. Confirm Table Editor sort/filter URL sync persists filters per table
without leaking across table switches
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
01d4d4d430 |
[FE-5113] refactor(studio): replace next/dynamic shim with React.lazy (#54022)
## Problem
Now that Studio runs on TanStack Start, `apps/studio` still routes 13
`next/dynamic` imports through a local compatibility shim
(`apps/studio/compat/next/dynamic.tsx` aliased in
`apps/studio/vite.config.ts`). Keeping the shim adds unnecessary
indirection during the Next.js teardown (FE-5113).
## Solution
Replaces every `next/dynamic` import in `apps/studio` with `React.lazy`
+ `Suspense` (or static imports where already inside a lazy chunk), then
deletes `compat/next/dynamic.tsx` and its Vite alias.
None of the previously `ssr: false` call sites need `ClientOnly`: Studio
runs TanStack Start with `spa: { enabled: true }` and only prerenders
the signed-out auth routes (`/sign-in`, `/sign-up`, `/sign-in-sso`,
`/forgot-password`), `__root.tsx` gates `<Outlet />` behind
`canRenderPage`, and `StudioCommandMenu` is already gated by
`useCommandMenuInitiated()` (which starts `false` per render).
**Removed:**
- `apps/studio/compat/next/dynamic.tsx` and the `'next/dynamic'` entry
in `nextShims` in `apps/studio/vite.config.ts`
**Changed:**
- Migrated all `next/dynamic` call sites to `React.lazy` + `Suspense`:
- `StudioCommandMenu`, `ContextSearchResults`,
`Marketplace/OverviewTab`, `QueryDetail` (`SqlMonacoBlock`),
`SQLEditorEditorPanel` (`MonacoEditor`, `DiffEditor`),
`SupportAssistantSuccessCard`, `LayoutSidebarProvider`,
`MessageMarkdown` (`Streamdown`), and
`SupportAssistantSuccessCardContent` (`Streamdown`)
- `ConnectStepsSection`: hoisted the lazy component cache out of
`useMemo` to module scope (also clears its
`react/no-unstable-nested-components` warning)
- `Integrations.constants.tsx` and `useAvailableIntegrations.tsx`:
hoisted all lazy integration tab/page definitions (including
`GraphiQLTab`) to module scope so `navigate()` returns stable component
references, added `Suspense` boundaries with `<Loading />` at both
render points (`MarketplaceDetail` and the integration child route), and
keyed integration tab/creation sheet instances (`integration.id` in
`MarketplaceDetail` and `wrapperMeta.name` in `WrappersTab`) so state
cannot leak when switching between wrappers or OAuth integrations;
preserves `umdAmdShortCircuit`, `ssrStubGraphiql`, and
`graphiqlViteWorkers` in `vite.config.ts`
- Replaced `dynamic()` calls for `AiIconAnimation`, `Badge`, and 4
`icons` in `CreateCommands.tsx` with static imports (already inside the
lazy `CommandMenu` chunk)
- Removed the stale `next/dynamic` mention from the
`lib/chunk-load-error.ts` doc comment (`React.lazy` chunk failures
continue bubbling to the root `ErrorBoundary` reload handler)
**Added:**
- Reference-stability tests for `INTEGRATIONS.navigate` in
`Integrations.constants.test.ts` (running in Vitest's Node environment)
## Review instructions
1. Open the SQL Editor and Query Performance query detail panel, and
confirm the Monaco editor and diff view load cleanly.
2. Open the GraphQL integration's GraphiQL tab, and confirm the loading
skeleton displays while the chunk loads and GraphiQL mounts with working
autocomplete/workers.
3. Open a Wrapper integration's Wrappers tab, open the create sheet,
then navigate via history to a different wrapper's create sheet and
confirm the form resets to the new wrapper's defaults.
4. Open the Command Menu (`Cmd+K`), navigate to context search (for
example, Search Database Tables) and Create commands, and confirm icons,
badges, and search results load without flicker.
5. Open the Connect sheet and switch between frameworks/steps,
confirming step content loads with the skeleton fallback.
6. Toggle sidebars (AI Assistant, Inline SQL Editor, Advisor, Help) and
verify markdown streaming in AI Assistant.
7. Confirm CI passes `pnpm --filter studio run build` (including
prerendering and chunk-cycle checks), typecheck, lint ratchet, and
Studio tests.
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
258004ea4d |
chore: improve pricing info on project creation (#54110)
Customers often misunderstand compute pricing. In an effort to make this a little more obvious without a huge revamp of the project creation, this PR: - Adds the compute billing animation that we use on plan upgrades to project creation - Expands the footer on project creation to be a bit more prominent |
||
|
|
730010e450 |
[FE-5112] refactor(studio): remove next/head shim and usages (#54015)
Removes the last four `next/head` usages in Studio along with the `compat/next/head.tsx` shim and its Vite alias. The shim was already a fragment passthrough relying on React 19's native `<title>` and `<meta>` hoisting, so the remaining callers can render those elements directly just like the rest of Studio's routes. **Changed:** - `ApiAuthorization.Valid`, `AccountLayout`, `OrganizationLayout`, and `ProjectLayout` – dropped `next/head` and `<Head>` wrappers in favor of inline `<title>` and `<meta>` elements - `AccountLayout.selfhosted.test.tsx` and `ProjectLayout/index.test.tsx` – removed `next/head` mocks so they assert against React 19's native title hoisting - `OrganizationLayout.test.tsx` and `tests/routes/authorize.test.tsx` – added `document.title` coverage for `OrganizationLayout` and the legacy `/authorize` screen **Removed:** - `apps/studio/compat/next/head.tsx` - `'next/head'` alias from `nextShims` in `apps/studio/vite.config.ts` Addresses [FE-5112](https://linear.app/supabase/issue/FE-5112/replace-the-nexthead-shim-with-tanstack-route-head). ## To test - Navigate across a project page (e.g. Table Editor), an organization page, and `/account/me` – browser tab title updates for each view - Open `/authorize?auth_id=...` with the legacy OAuth flow – tab title updates to `Authorize <app name> | Supabase` once the request loads Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
87b9d0562e |
[FE-5111] refactor(studio): replace next/image shims with plain img (#54011)
Replaces all remaining `next/image` and `next/legacy/image` imports in `apps/studio` with plain `<img>` elements and deletes both compat shims and their Vite aliases (following #53906, which removed the last `next/image` import from `packages/ui-patterns`). **Changed:** - Replaced 26 `next/image` and 3 `next/legacy/image` call sites across `apps/studio` with plain `<img>` elements (every local `src` already prepends `BASE_PATH` / `router.basePath`, and none used `loader`, `priority`, `placeholder`, `quality`, or `onLoadingComplete`) - Converted `fill` / `layout="fill"` usages in `IntegrationCard`, `MarketplaceFeaturedHeroGrid`, `Integrations.constants`, `useAvailableIntegrations`, and `IntegrationPanels` to Tailwind sizing classes, and dropped no-op `layout="fixed"` props in `FormContents` and `HookList` - Replaced invalid `layout="fill" objectFit="cover"` props passed to `next/image` in `HelpPanel` with `absolute inset-0 h-full w-full object-cover` - Cleaned up image accessibility across the touched call sites (accurate alt text on feature preview screenshots and `HookList`, `alt=""` + `aria-hidden="true"` on decorative icons/illustrations next to visible labels) **Removed:** - `apps/studio/compat/next/image.tsx` - `apps/studio/compat/next/legacy/image.tsx` - `'next/image'` and `'next/legacy/image'` aliases from `apps/studio/vite.config.ts` ## To test - Confirm `git grep -E "next/(legacy/)?image" apps/studio/` has no remaining imports - Check images render as expected across the updated surfaces: - **Integrations marketplace** (`/project/_/integrations`): featured hero covers (`MarketplaceFeaturedHeroGrid`), integration icons in cards, sidebar, and wrapper rows (`Integrations.constants`, `useAvailableIntegrations`) - **Help panel**: Discord card background illustration - **Account & settings**: Account Connections GitHub icon, Add-ons cards (IPv4 / PITR / Custom Domain), Spend Cap card & side panel, user profile avatars (`ProfileImage`), and Feature Previews modal images - **Database Webhooks** (`FormContents`, `HookList`) and Third-Party Auth provider dropdown/cards --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
0246fb34b5 |
fix: clear free project limit cache on project operations (#54108)
When pausing/creating/restoring/cloning a project, we are not clearing the react-query cache for the free project limit check and therefore still displaying potentially wrong states to the user. PR addresses this by clearing the free project limit react query cache on relevant project operations. |
||
|
|
5d897958ec |
feat: project resume costs (#54107)
Currently, when resuming a project, the cost is not clear and we just have a generic inline "Once resumed, usage will be billed by compute size and hours active." copy. This commonly leads to people missing that resuming causing extra compute costs. |
||
|
|
574cd4ba46 |
chore: remove old plan change UI (#54105)
Revamped plan change UI is fully rolled out for everyone. Removing the now obsolete components. |
||
|
|
52a7fddc95 |
Joshenlim/fe 5198 clean up to be cleaned folder (#54106)
## Context Another housekeeping - just deprecates the `to-be-cleaned` folder - Removes `ListIcon -> Only `vercelIcon` was being used which I've replaced to use the existing static SVG instead - Removes `ProductEmptyState` -> replaced with `EmptyStatePresentational` |
||
|
|
7c6366d979 |
Added myself to humans.txt (#54094)
## Problem An onboarding task is suggesting to add my name in humans.txt. ## Solution Added my name in the list. <!-- ## 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 Optionally add any other context or screenshots. --> ## Review instructions 1. Ensure name is correct. 2. Ensure name has been inserted at the correct location. ## 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) |
||
|
|
79da6ab86f |
docs(storage): add object versioning and lifecycle policies guides (#51566)
## What Adds docs for the Storage object versioning private alpha and bucket lifecycle policies for noncurrent versions. - New: `storage/buckets/object-versioning.mdx`, `storage/buckets/lifecycle-policies.mdx`, plus nav entries - Updated: copy/move, delete objects (versioned buckets and `aws s3 sync`), S3 compatibility (lifecycle rows, versioning note), schema diagram (versioning columns), storage size (noncurrent versions count toward storage size; current vs noncurrent query) |
||
|
|
8f75187422 |
fix(studio): stop dev No queryFn error from grantedQueryOptions (#54004)
Fixes TanStack Query spamming `No queryFn was passed as an option` in dev whenever a grant-gated query renders without a grant or required variable (such as `branchesQueryOptions` when `projectRef` is `undefined`). **Changed:** - Replaced `queryFn: undefined` in `grantedQueryOptions` with a stable `fallbackQueryFn` while keeping `enabled: false`. This satisfies `useBaseQuery`'s dev-mode check and still delegates to a subscribed granted observer on invalidation (avoiding the `skipToken` shared-cache regression from #53088). - Updated `granted-query-options.test.ts` and `api-keys-query.test.tsx` to verify no `console.error` is logged when rendering without a grant or `projectRef` and that invalidation still refetches via the granted observer. - Updated the `studio-queries` skill note to match. ## To test - Run `pnpm dev:studio` and open a non-branch project's home page. Confirm the browser console and dev terminal no longer spam `[["projects",null,"branches"]]: No queryFn was passed as an option`. - Open Project Settings -> API Keys, create or delete a key, and confirm the list still refreshes cleanly. - Run `pnpm --filter studio test data/granted-query-options.test.ts data/api-keys/api-keys-query.test.tsx`. Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
0d9e021060 |
docs(ref): add Swift v3 alpha reference (#53896)
## Problem supabase-swift v3 is in alpha (`3.0.0-alpha.2`). The docs have no reference for it. v3 renames many public APIs, so the v2 reference does not help people who try the alpha. ## Solution Add a v3 reference at `/reference/swift/v3`. v2 stays the default at `/reference/swift`. - **Prerelease flag.** A version in `REFERENCES` can now set `prerelease: 'alpha'` (or another stage). Swift versions are `['v2', 'v3', 'v1']`. `versions[0]` is still the latest stable version, so the existing URL and "latest" logic does not change. Other SDKs can use the same flag. - **Alpha notice.** A prerelease page shows "This version is in alpha" with a link to the stable version. It does not show the "Version out of date" warning. - **Version menu.** Prerelease versions show in a separate "Prereleases" group with a stage badge. - **Spec.** `spec/supabase_swift_v3.yml` ports the v2 spec to the v3 API. The examples were checked against the v3 source at the `v3.0.0-alpha.2` tag. It adds the new v3 APIs: MFA recovery codes, `AuthAdminClient`, admin custom providers, `functions.stream`, and the Realtime streams API. - **Pages.** New introduction, installing (Xcode 26, Swift 6.2), and upgrade guide pages under `docs/ref/swift/v3/`. - **Navigation.** Nav entries for v3. v3 is excluded from the "TypeScript support" section. Not in this PR: - Search indexing for v3. Search still covers v2 only. - In the v2 spec, 7 filter ids use camelCase (for example `containedBy` and `textSearch`). They match no section, so they do not render in the v2 docs today. The v3 spec uses the matching kebab-case ids. The v2 fix can be a separate PR. ## Review instructions 1. Open `/docs/reference/swift/v3` on the preview. See the alpha notice and the v3 sections. 2. Open the version menu. See "Stable releases" (v2.0 with a "Latest" badge, v1.0) and "Prereleases" (v3.0 with an "Alpha" badge). 3. Open `/docs/reference/swift`. See that it still shows v2 with no notice. 4. Read the upgrade guide at `/docs/reference/swift/v3/upgrade-guide`. Typecheck, Prettier, and ESLint pass locally. I did not run the docs unit tests. The Swift examples were not compiled. <img width="318" height="236" alt="Screenshot 2026-11-25 at 10 36 01" src="https://github.com/user-attachments/assets/0f0caf18-7a4a-4835-8f6a-b76df9c66fa9" /> <img width="685" height="417" alt="Screenshot 2026-11-25 at 10 36 10" src="https://github.com/user-attachments/assets/1c55bc44-1fc1-4390-8d8c-48bc55822bd3" /> ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
08e5819707 |
docs: add Diogo Biazus as per onboarding process (#53061)
Same as #52956 but now from the proper repo ## Problem My onboarding instructions asked me to add myself to humans.txt. While doing so I noticed there was an inconsistency in the alphabetical order near my name. ## Solution I added my name to the list and reordered a few surrounding names. ## Review instructions Check that "Diogo Biazus" is in the list on the expected position. ## 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) |
||
|
|
ce80792683 | feat(docs): Improve Pipelines docs (#54045) | ||
|
|
af75c3f8d9 |
Change deprecation notice in docs to mention early 2027 (#54052)
A notice was added in the Project's Settings -> API Keys page via [pull request 52250](https://github.com/supabase/supabase/pull/52250) that mentions `Legacy API keys will be retired in early 2027` but the notice in the docs still mentions `Supabase is deprecating the anon and service_role keys by the end of 2026`. This pull request updates the docs to be consistent with the Dashboard UI to avoid confusion. |
||
|
|
107b7dbad2 |
feat(studio): already approved request preselect org and projects (#54036)
## Problem When users navigate back to the consent screen after a redirect error, they have to reselect the org and projects despite the request having been approved already ## Solution When present, `approved_organization_slug` should set the organization picker and override `organization_slug` from query parameters. Likewise, `approved_project_refs` should take precedence over project refs from query parameters or an existing grant in the preflight check. |
||
|
|
6a305cd311 |
docs(skills): treat user-defined names as sensitive in telemetry-standards (#53963)
## Problem The `telemetry-standards` skill only says not to track PII. It doesn't cover other identifiers from a user's project, such as schema or table names. Those are customer data and outside our privacy policy, but nothing told contributors or reviewers to avoid them. The skill also pointed at existing `schema_name` and `table_name` properties as conventions to match, which invites copying them. This came up in #53955, where schema names were masked because they weren't needed. ## Solution Updates `.agents/skills/telemetry-standards/SKILL.md`: - New Privacy section requiring that schema, table, column, function, bucket, policy, project and branch names be masked or omitted, along with other user-defined names, SQL and free text, and extra IDs. It notes that `useTrack` already attaches the project ref and org slug. - Recommends counts, enums, booleans or action categories instead of raw names, and typing new properties as string-literal unions rather than plain `string`. - Short masked vs unmasked example. - Reviewers now flag this as a required change (new rule 6), and the verification checklist has matching items. - The Property Standards note now says to match casing only and not copy existing `schema_name` or `table_name` properties. - The event definition template uses a literal union instead of `string`, so it no longer contradicts the rule. ## How to verify Read the diff of `.agents/skills/telemetry-standards/SKILL.md`. Each identifier listed in FE-5207 appears in the Privacy section and in review rule 6. No code changes. Fixes FE-5207 --------- Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com> |
||
|
|
7960616cf9 |
fix(docs): use the sub claim in the storage copy/move policy examples (#53953)
Fixes #53952 ## What changed The Copy and Move Objects guide has three RLS policy examples that compare `storage.objects.owner_id` (`text`) and the output of `storage.foldername()` (`text[]`) with `auth.uid()` (`uuid`). Postgres has no implicit cast between `text` and `uuid`, so any query governed by these policies fails with `operator does not exist: text = uuid`. This PR changes the comparisons to use `auth.jwt()->>'sub'`, matching the pattern already used in the storage access control and delete objects guides. ## Verification - Reproduced the original error against a local Postgres instance. - Confirmed the corrected expressions run without errors. - No links or anchors changed. I used AI to help debug and verify this against a local Postgres instance, and I personally reviewed the final change. --------- Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
3643bc656d |
fix(docs): keyboard shortcut hydration (#53959)
## Problem - on macOS, a docs page reload shows "Ctrl K" in the search box before "⌘ K" - a signed-in user sees the "Sign up" button on reload until auth loads ## Solution - changes `KeyboardShortcut` to resolve the ⌘ and ⌥ keys after hydration + hides them until then - adds a test that fails when the server html shows a platform key - removes the separate mac check from the kb hero search <!-- ## 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 Optionally add any other context or screenshots. --> ## Review instructions 1. on a mac, open [/docs](https://docs-git-fix-keyboard-shortcut-hydration-supabase.vercel.app/docs) and reload the page 2. make sure that the search box shows "⌘ K" with no "Ctrl K" before it ## 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) |
||
|
|
b3076f07b2 |
Add Lyric Hartley to humans.txt (#53081)
## Problem My name was not in the file. ## Solution Added my name ## Review instructions See that my name is there Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
041c363873 |
fix(docs): layout v2 fixtures (#53761)
## Problem - keyboard users hit focus problems in the option-1 docs layout because the on this page rail clips focus rings and Firefox adds an unlabeled tab stop on the sidebar scroll area - skip link to the content does not render - reference sits in a dropdown next to the logo which doesn't feel optimal - header breadcrumbs repeat the sidebar section with group crumbs that never link ## Solution - fixes the focus rings and tab stops in the sidebar, the rails and the footers so each ring is inset and is not clipped - changes the header breadcrumbs to show the parent and the page + links a group crumb to its overview page when it has one - moves reference into the sidebar section list with a back button + removes the sections dropdown and points the logo to the docs home - moves the knowledge base to the top of the sidebar footer and removes the changelog link - removes the hover backgrounds and color transitions from the sidebar and rail rows + fades the sidebar list under the back button on scroll - aligns the home agent prompt with the second framework column and changes the footer separator to a square <!-- ## 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 Optionally add any other context or screenshots. --> 1. visit [/docs/guides/database/replication/pipelines?docs-ia-mvp-v1=option-1](https://docs-git-antlio-fix-docs-layout-v2-nits-supabase.vercel.app/docs/guides/database/replication/pipelines?docs-ia-mvp-v1=option-1) 2. reload the page and press Tab once to make sure that the first stop is the skip link to the content 3. press Tab through the sidebar, the on this page rail and the page footer to make sure that each ring is inset and round and is not clipped 4. click the back button in the sidebar until the section list shows, then click `Reference` to make sure that it opens the reference list with a back button ## 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) |
||
|
|
a36d21848c |
feat(studio): note that edge function secrets can't be retrieved once saved (#54037)
## Problem The "Add or replace secrets" form on the Edge Functions secrets page doesn't tell users that a secret's value can't be viewed again after saving. Only the "Edit secret" sheet says so, after the value is already saved. ## Solution The Value field's description in the "Add or replace secrets" form now says that secrets can't be retrieved once saved, using the same wording as the Edit secret sheet. Users see this before they save a value. ## How to verify 1. Open `/project/<ref>/functions/secrets` in the Studio preview. 2. In the "Add or replace secrets" card, the Value field's description reads "Supports multi-line values such as PEM keys, JSON, or functions. Secrets can’t be retrieved once saved." 3. Click "Add another": the new row's Value field shows the same description. 4. Add a secret and save it: it saves and appears in the secrets list as before. 5. Open an existing secret's Edit sheet: its note is unchanged. ## Checks Ran `pnpm turbo run typecheck --filter=studio`, `eslint` on the changed file, `oxfmt --check` on the changed file, and `vitest run` on `AddNewSecretForm.test.tsx`. All pass. ## 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 [FE-5223](https://linear.app/supabase/issue/FE-5223/add-mention-that-edge-function-secrets-cannot-be-retrieved-after). Tedd doesn't read comments on this PR. Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
d6e4089b1a |
feat(common): add FrameworkProvider and remove next imports (#53905)
Introduces a lightweight `FrameworkProvider` React context in `packages/common` (`Link`, `Image`, `pathname`, `asPath`, `isReady`, `params`, `push`), wires it up in the consuming apps, and removes the `next` dependency from `packages/common`. **Added:** - `FrameworkProvider`, `useFramework`, `FrameworkLink`, and `FrameworkImage` in `packages/common/framework.tsx`, with plain HTML defaults (`DefaultFrameworkLink` / `DefaultFrameworkImage`). `useFramework().push` always exists and falls back to `window.location.assign` - App-level framework providers wiring `next/link`, `next/image`, and router state in `www` (App + Pages routers), `docs`, `design-system`, `learn`, and `ui-library`, and native TanStack Router bindings in `studio` (`StudioFrameworkProvider`) - `StudioFrameworkProvider` reuses the common defaults (its image only applies the basePath) and reports `isReady` once the first route load commits, so the first page view carries the final route after any redirect - Unit tests for `StudioFrameworkProvider` (`useParams`, `FrameworkLink`, `FrameworkImage`, query/hash-only navigation, `isReady`) and for `PageTelemetry` route-change sends and the `TelemetryTagManager` consent gate **Changed:** - `common/hooks/useParams.ts`: read params from `useFramework()` instead of `next/compat/router` - `common/telemetry.tsx`: replace `next/script` in `TelemetryTagManager` with `useEffect` script injection, and read route state from `useFramework()` in `PageTelemetry` - `common/MetaFavicons/app-router.ts`: drop type-only `Metadata` import from `next` - Moved `MetaFaviconsPagesRouter` to `apps/www/components/MetaFaviconsPagesRouter.tsx` (its sole consumer) - Studio: `toRoutePattern` and `applyBasePath` now live once in `lib/internal-url.ts`, shared by the provider and the `compat/next` shims - `PageTelemetry` throws outside production when no `FrameworkProvider` is mounted, since it would otherwise send only the landing pageview. `useFramework()` itself still falls back to the defaults - `ui-library`: renamed its code-sample framework context to `FrameworkPreferenceProvider` / `useFrameworkPreference` so `FrameworkProvider` only means the `common` one **Removed:** - `learn`'s unused copy of that context (`useCourse` had no callers) - `next` from `packages/common/package.json` peerDependencies App Router adapters set `asPath` to the pathname only, same as the `usePathname`-based telemetry on master (reading search params at the root would opt static pages out of static rendering). ## To test - Run `packages/common` tests and typecheck, and `apps/studio` `StudioFrameworkProvider` / `route-render` / `telemetry` tests - Navigate between routes in Studio, Docs, and WWW and confirm page telemetry fires once per navigation (and does not duplicate on hash-only changes) - Load Studio at `/` (which redirects) and confirm the first page event has the final route - Verify URL params (`useParams`) continue resolving route and search params in Studio --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
e508c3c3f0 |
feat(studio): track schema visualizer usage (#53955)
## Problem The schema visualizer (`/project/[ref]/database/schemas`) sends no telemetry. We can't tell whether people use it to explore a schema or to export it, which export format they pick, or whether they edit tables from the graph. ## Solution Adds PostHog events for the visualizer's main actions: changing the schema, selecting a Find table result, copying (schema or table as SQL/Markdown, table or column name), downloading the graph as PNG or SVG, applying Auto layout, and choosing Edit table or Edit column from a node menu. Each event fires from the action's handler, so actions started from a keyboard shortcut count too. Properties are only fixed enums (`schemaType`, `content`, `format`, `action`); no schema, table, or column names are sent. Each tracked element also gets a `data-attr` for autocapture. View in Table Editor and the empty state's New table link get a `data-attr` only, because the pageview already records them. It also fixes an empty canvas after switching back to a schema that was already loaded. The graph stays mounted in that case and fitted the view only on first load, so the new schema's tables could sit off-screen until a reload. The view now fits whenever the schema on the canvas changes. Edits within the same schema still keep the current view. Studio's database pages keep the selected schema name in the `schema` URL param, and that name is chosen by the customer. Telemetry now redacts its value to `redacted` wherever it already redacts `keywords`: the event and pageview `page_url`, the query string, the referrer, first-touch data, and the URL properties posthog-js adds. This applies to every Studio event and pageview, not just this page. Params that only contain the word, such as `schemas` or `myschema`, are left alone. ## How to verify On the PR preview, open a project's Database > Schema Visualizer with PostHog debugging on (or watch the network requests to the telemetry endpoint), then: 1. Change the schema in the selector: one `database_schema_selector_updated` event with `schemaType` of `public`, `protected` (for example `auth`), or `custom`. 2. Open Find table and select a table: one `database_schema_visualizer_find_table_clicked` event. 3. Click Copy as SQL: one `database_schema_visualizer_copied` with `content: 'schema_sql'`. Copy as Markdown from the export menu sends `content: 'schema_markdown'`. 4. Download as PNG and as SVG: one `database_schema_visualizer_image_download_clicked` each, with `format` of `png` or `svg`. 5. Open Auto layout and click Apply: one `database_schema_visualizer_auto_layout_applied`. Cancel sends nothing. 6. From a table node menu, choose Copy name, Copy as SQL, and Copy as Markdown: `database_schema_visualizer_copied` with `content` of `table_name`, `table_sql`, and `table_markdown`. Column menu Copy name sends `column_name`. 7. From a table node menu choose Edit table, and from a column menu choose Edit column: `database_schema_visualizer_node_menu_clicked` with `action` of `edit_table` and `edit_column`. 8. No event carries a schema, table, or column name. 9. Switch the schema from public to auth, then back to public, with no reload: the public tables are shown and fitted on the canvas each time. Repeat auth → public → auth. 10. Edit a column from the graph and save: the view does not jump. 11. In the telemetry requests from steps 1 to 7 and in the pageview, `page_url` and `ph.search` show `schema=redacted`, never the schema name. The page itself still shows and switches the real schema. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`. Every package passed except studio, which ran out of memory beside a parallel lint run. `pnpm --filter studio run typecheck` alone then passed, and passed again after the view fix. `pnpm turbo run lint --filter='[origin/master]'` ran out of memory twice on studio's `lint:type-checks` (2 GB default heap). So I ran `eslint` and `eslint --config eslint.type-checks.config.cjs` on the changed Studio files with a larger heap: no errors, only pre-existing warnings. `vitest run components/interfaces/Database/Schemas/Schemas.utils.test.ts` passed. For the redaction, `vitest run` in `packages/common` (all 310 tests, including the new `schema` cases) and its `typecheck` passed; `common` has no lint script. `oxfmt --check` passes on all changed files. Event names and properties follow the repo's `telemetry-standards` skill. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] The change is scoped to one feature - [x] Events are defined in `packages/common/telemetry-constants.ts` and added to the `TelemetryEvent` union ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [FE-5031](https://linear.app/supabase/issue/FE-5031/track-usage-on-the-schema-visualizer). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
653f914ca1 |
feat: post plan upgrade screen (#54003)
Right now, when customers upgrade from free → paid or even pro → team, we simply redirect to the org billing page with a quick banner that vanishes after 3 seconds confirming the plan was changed. it’s quite unsatisfying and feels like a missed opportunity to display what the customer now unlocked and next steps. I want to especially highlight projects that are now upgradeable from nano → micro, but we can later expand and make the “next steps” smarter and do it context-based. |
||
|
|
4fa8afe918 | feat(studio): support grouped OR filters in unified logs (#53943) | ||
|
|
a1616e0076 |
docs(cli): supabase init creates config.jsonc for new projects (#53857)
## Problem Since CLI 3.4.0 (released 2026-11-24), `supabase init` creates `supabase/config.jsonc` for new projects instead of `supabase/config.toml`. The file starts with a `$schema` key, so editors get validation and autocomplete straight away. Projects that already have a `config.toml` aren't touched, and the CLI keeps reading it the same way. A handful of guides still say `init` creates `config.toml`. ## Solution - `cli/config-formats.mdx`: the file table marks `config.jsonc` as the one `init` creates in CLI 3.4.0 and later, and the "Minimum CLI version" section says earlier versions create `config.toml`. Under the table there's a short line saying a `config.toml` project keeps working, and pointing at `supabase config convert --to toml` for anyone who wants TOML. The schema section says `init` writes the `$schema` key into `config.jsonc`, rather than the TOML `#:schema` line. - `cli/getting-started.mdx`: the setup admonition and the `supabase init` step name `config.jsonc`, and the step mentions `config convert --to toml` with a link to Config file formats. - `managing-config.mdx`, `cli-workflows.mdx` (step 1 and the key commands table) and `running-multiple-local-projects.mdx` (the `SUPABASE_EXPERIMENTAL_STACK=1 supabase init` bit) had the same "init creates `config.toml`" statement, so I've updated those too. I've left the many "edit `supabase/config.toml`" references across the other guides alone - they're about where a setting lives rather than what `init` creates, and the per-format config examples cover them. ## Review instructions 1. Open Config file formats, CLI getting started, Managing config and Local development workflow on the preview. 2. Check they say `supabase init` creates `config.jsonc` (CLI 3.4.0 and later), and that `config.toml` projects are described as still working. 3. Check the `--to toml` links land on the "Convert back to TOML" section. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
8597e7dc5a |
feat(studio): oauth apps form update (#53893)
## Problem The Authorization section of the OAuth app publish form was two toggles, each with its own inline warning box and its own "I understand this is permanent" checkbox, plus a static info box describing what users would see. Two problems with that: - The settings are a one-way door, so the permanence warning appeared twice and was easy to click past. - Nothing showed what the two settings combine into, or what the person connecting the app actually ends up seeing. ## Solution UI only — the saved fields (`grant_kind`, `project_scoping_mode`) and the save logic are unchanged, and `allow_partial_grants` is untouched. - **Two radio groups** in place of the toggles: "Who approves access?" (an owner, once for the org / each member, for themselves) and "Which projects can it reach?" (all projects / let them choose). Built on `RadioGroupStacked`, grouped with `fieldset`/`legend`. - **One-way door made visible**: the saved option carries a `Current` badge, the stricter options carry `Permanent`, and once a stricter value is saved the looser option is disabled and badged `Can't switch back`. - **Live preview** replaces the info box: a dimmed, cropped view of the real consent screen, reusing `ScopeGroupCard` and the interstitial's width, so it reflects the app's actual scopes and updates as the radios change. A footer row states the resulting grant, and what it is today when there are unsaved changes. - **One confirmation, at save time**: both inline warnings and their checkboxes are gone. Saving a stricter value opens a `ConfirmationModal` listing only what changed, with a single acknowledgement checkbox gating "Save permanently". Unit tests cover the badge/locking states and the preview; the dialog's bullets and acknowledgement gate have their own tests. ## Review instructions 1. Enable the `enableScopedOAuthPublish` flag and open **Organization settings → OAuth Apps**. 2. Publish a new app. Both questions should default to the looser option with no `Current` badges, and the stricter options should show `Permanent`. 3. Change each radio and watch the preview and the "Resulting grant" line update — switching "Which projects can it reach?" should swap the fixed projects row for the picker. 4. Save with a stricter value selected. Confirm the dialog lists only the changes you made, and that "Save permanently" stays disabled until the checkbox is ticked. 5. Reopen the app. The saved values should show `Current`, and the looser options should be disabled and badged `Can't switch back`. 6. Edit an app without touching authorization and save — no dialog should appear. --------- Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com> |
||
|
|
0fa521d64a |
chore: small nano compute docs improvements (#54005)
Make it a bit clearer that Nano instances are for Free Plan and not free in itself |
||
|
|
36e370aa5c |
docs(ai): explain how hnsw.ef_search caps HNSW results and how to set it (#53997)
## Problem The HNSW tuning section said only that a higher `ef_search` gives better accuracy and slower queries. A reader whose query uses a `limit` above `ef_search` gets fewer rows back. The docs didn't explain why, what the range is, or how to change the setting. Related to [FDBKIN-12895](https://linear.app/supabase/issue/FDBKIN-12895/document-performance-trade-offs-of-pgvectors-hnsw-ef-search-parameter) Closes [DOCS-1800](https://linear.app/supabase/issue/DOCS-1800/explain-that-hnswef-search-caps-hnsw-results-and-how-to-set-it) ## Solution The `ef_search` bullet on the "Going to production" guide now names the `hnsw.ef_search` setting, its default, and its valid range. Plain paragraphs after the list explain how it caps the rows an HNSW scan returns and how to set it. They cover a session, one transaction, a transaction-mode pooler, and a database function called through the Data API. They also point to iterative index scans for returning more rows, and don't repeat that explanation. The filtering section of the HNSW indexes page now names `hnsw.ef_search` as the limit, so the two pages agree. ## How to verify 1. Open https://docs-git-tedd-docs-1800-supabase.vercel.app/docs/guides/ai/going-to-prod#hnsw-understanding-efconstruction--efsearch--and-m and https://docs-git-tedd-docs-1800-supabase.vercel.app/docs/guides/ai/vector-indexes/hnsw-indexes#filtering-with-hnsw-indexes. 2. The `ef_search` bullet states the `hnsw.ef_search` default (40) and range (1 to 1,000), and stays one paragraph like the `m` and `ef_construction` bullets. 3. A paragraph after the list says that without iterative index scans, an HNSW index scan returns at most `ef_search` rows, even when the query's `limit` is larger. 4. A SQL block shows a `set` statement and a `set local` statement inside `begin` / `commit`. A second SQL block shows a database function with a `set hnsw.ef_search = 100` clause. 5. The paragraph about setting the value links to "Transaction mode limitations" and to "Querying a vector / embedding", and both links land on those sections. 6. A paragraph links to "Filtering with HNSW indexes", and the link lands on that section. 7. In "Filtering with HNSW indexes", the sentence about selective filters names `hnsw.ef_search` as the limit on rows a scan returns, and its link lands on the going-to-prod HNSW section. ## Checks Ran `pnpm turbo run typecheck`, `pnpm turbo run lint`, and `pnpm exec oxfmt --check` on the changed docs. Ran both SQL blocks in page order on Postgres 18 with pgvector 0.8.1, against 20k random vectors with an HNSW `vector_l2_ops` index and `vector` installed in the `extensions` schema. At the default, `limit 100` returned 40 rows. With `set` or `set local hnsw.ef_search = 100`, it returned 100 rows. The `set local` value reset after `commit`, and `1001` was rejected as outside 1..1000. The function with `set hnsw.ef_search = 100` returned 100 rows for `limit 200`, and the session value stayed at 40. At `ef_search = 1000`, `limit 1500` returned 1000 rows, and 1500 after `set hnsw.iterative_scan = relaxed_order`. Docs tests skipped: they need Docker. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1800](https://linear.app/supabase/issue/DOCS-1800/explain-that-hnswef-search-caps-hnsw-results-and-how-to-set-it). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
528e2d0a98 |
docs(self-hosting): explain how Edge Functions workers are reused across requests (#53996)
## Problem The self-hosted Functions guide lists worker timeouts and idle cleanup, but never says that a running worker serves later requests. The Docker guide says the main worker loads each function from disk per request, which suggests top-level setup runs on every request. Related to [FDBKIN-22732](https://linear.app/supabase/issue/FDBKIN-22732/clarify-edge-functions-worker-lifecycle-and-reuse-strategy-for-self) Closes [DOCS-1799](https://linear.app/supabase/issue/DOCS-1799/explain-how-self-hosted-edge-functions-reuse-workers-across-requests) ## Solution A new "Worker lifecycle" section on the self-hosted Functions guide explains that the default `per_worker` policy sends requests to a function's running workers. Concurrent cold requests can start up to one worker per CPU, and later requests rotate across them. It says that top-level code runs once per worker, so heavy setup belongs there. It also lists the events that stop a worker from taking new requests, including retirement at half of `workerTimeoutMs`, links to the existing timeout and cleanup sections, and names the settings that keep workers alive longer. The Docker guide's sentence now says that a restart stops running workers, so the next request picks up changed code. ## How to verify 1. Open https://docs-git-tedd-docs-1799-supabase.vercel.app/docs/guides/self-hosting/self-hosted-functions#worker-lifecycle and https://docs-git-tedd-docs-1799-supabase.vercel.app/docs/guides/self-hosting/docker#accessing-edge-functions. 2. The Worker lifecycle section says that requests go to a running worker for the function, that concurrent cold requests might each start a worker up to the number of CPUs, and that later requests rotate across those workers. 3. It says that top-level code runs once per worker, that heavy setup goes at the top level, and that top-level state belongs to one worker. 4. It lists reaching half of `workerTimeoutMs`, no requests, idle-worker cleanup, an error or resource limit, and a service restart as events that stop a worker from taking new requests, and says a new worker starts when the function has none left. The links to Timeout errors, Idle-worker cleanup, Per-worker memory limit, and Container memory budget go to those sections. 5. It names `requestAbsentTimeoutMs` and `workerTimeoutMs` as the settings to raise to keep workers alive longer. 6. The Docker guide no longer says functions load from disk per request, and still says a restart picks up new or changed function code. ## Checks Ran `pnpm turbo run lint typecheck` on the changed packages and `pnpm exec oxfmt --check` on the changed files. Checked the facts against `docker/volumes/functions/main/index.ts` and `docker/docker-compose.yml` in this repo, and against `supabase/edge-runtime` at `v1.79.2` (the compose image tag): `cli/src/flags.rs` (`--policy` default), `crates/base/src/worker/pool.rs` (worker reuse, rotation, concurrent creation, and retirement), `crates/base/src/worker/supervisor/strategy_per_worker.rs` (early retirement at half of the wall-clock limit), and `ext/workers/user_workers.js` (`forceCreate` default). Docs tests need Docker and were skipped. Reuse wasn't tested against a running stack. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have checked that the change follows the docs style guide - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1799](https://linear.app/supabase/issue/DOCS-1799/explain-how-self-hosted-edge-functions-reuse-workers-across-requests). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
74cb5aa97a |
docs(rls): warn that an auth.uid() is null branch exposes every row (#53995)
## Problem The RLS guide explains that `auth.uid()` is `null` for a request without a user, but not what happens when a policy tests for `null` on purpose. A condition such as `auth.uid() is null or auth.uid() = user_id` returns every row to such a request. The guide also never says which roles a policy with no `to` clause applies to. Related to [FDBKIN-31059](https://linear.app/supabase/issue/FDBKIN-31059/update-rls-documentation-to-warn-against-common-anon-leak-policy) Closes [DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row) ## Solution The `auth.uid()` section of the RLS guide now states in body text when `auth.uid()` is `null` and what an owner comparison returns then. A `danger` admonition replaces the old caution: it shows the insecure `is null` branch, explains why `to authenticated` alone doesn't fix it, and gives a safe owner-only policy to copy. "Specify roles in your policies" now says that a policy with no `to` clause applies to `public`, which includes `anon`. The old advice to add `auth.uid() IS NOT NULL AND` is removed, because the plain comparison already returns no rows for such requests. ## How to verify 1. Open https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#authuid and https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#specify-roles-in-your-policies. 2. The `auth.uid()` section says it returns `null` for any request whose JWT has no `sub`, including every `anon` request. 3. A danger admonition warns that an `auth.uid() is null` branch returns every row to such requests, and that `to authenticated` doesn't remove the risk. 4. The admonition ends with a copyable policy that uses `to authenticated` and `(select auth.uid()) = user_id`, with no `is null` branch. 5. "Specify roles in your policies" says a policy with no `to` clause applies to `public`, which every role, including `anon`, is a member of. 6. The new link from "Specify roles in your policies" (`#authuid`) jumps to the `auth.uid()` section. ## Checks Ran `pnpm exec oxfmt --check` on the changed page. ESLint ignores MDX files. Ran both SQL snippets in PGlite 0.4.5 with `anon` and `authenticated` roles, Supabase's `auth.uid()` definition, a two-row table with `select` granted to both roles, and RLS on. With the insecure policy and no `to`, `anon` reads both rows. With `to authenticated`, a request with no `sub` reads both rows. With the safe policy, a user reads only their own row and a request with no `sub` reads none. A policy with no `to` lists `public` in `pg_policies.roles`, which matches the Postgres `CREATE POLICY` docs. `pnpm build:guides-markdown` was not run, because its federated-content step needs GitHub credentials. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
13d1f13107 |
docs(platform): explain what a custom domain is for and that it must be a subdomain (#53993)
## Problem The Custom Domains page didn't say what a custom domain is for. The subdomain-only rule appeared only in the CLI prerequisites. A reader who uses the dashboard, or reads only the intro and Limitations, could think they can't use their own domain. They could also think the add-on hosts their website on the root domain. Related to [FDBKIN-15980](https://linear.app/supabase/issue/FDBKIN-15980/clarify-that-custom-domains-are-for-api-endpoints-not-website-hosting) Closes [DOCS-1797](https://linear.app/supabase/issue/DOCS-1797/explain-that-a-custom-domain-replaces-the-project-api-url-and-must-be) ## Solution The intro now says that a custom domain serves the project's API, alongside the default `<project-ref>.supabase.co` domain, for Auth, Storage, Edge Functions, and other API requests. Limitations now states the subdomain rule for every setup path. It also widens the existing hosting bullet: a custom domain isn't intended for hosting frontend apps, and readers can host their website on the root domain with their own hosting provider. The CLI prerequisite keeps the subdomain step without repeating the rule. The intro says "alongside" rather than "replaces", because the default domain keeps working after activation. The hosting bullet keeps the "not intended" framing, because Edge Functions can serve HTML only on a custom domain. Preview: [Custom domains](https://docs-git-tedd-docs-1797-supabase.vercel.app/docs/guides/platform/custom-domains#limitations) ## Checks Ran `pnpm exec oxfmt --check` on the changed file. Checked facts against the page's activation steps, the Edge Functions limits page, and Studio's custom domain form, which asks for a subdomain. Skipped `pnpm build:guides-markdown`: its `build:federated-content` dependency needs GitHub credentials that the build environment didn't have. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1797](https://linear.app/supabase/issue/DOCS-1797/explain-that-a-custom-domain-replaces-the-project-api-url-and-must-be). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
caf7baaf08 |
docs(auth): show RLS policies that match the Firebase user ID (#53992)
## Problem The Firebase Auth guide sets up the client, the integration, the `role` claim, and the issuer check, but never shows how to limit rows to the signed-in Firebase user. The obvious helper, `auth.uid()`, fails with Firebase UIDs. Related to [FDBKIN-16284](https://linear.app/supabase/issue/FDBKIN-16284/provide-a-clear-process-for-connecting-firebase-auth-to-supabase-rls) Closes [DOCS-1796](https://linear.app/supabase/issue/DOCS-1796/show-how-to-write-rls-policies-that-match-the-firebase-user-id) ## Solution Adds a short "Write RLS policies for Firebase users" section to the Firebase Auth guide. It explains that `sub` holds the Firebase `uid`, shows a select policy that compares a `text` column with `(select auth.jwt()->>'sub')`, and says to use `auth.jwt()->>'sub'` in place of `auth.uid()`, which casts `sub` to `uuid`. The snippet uses the same shape and placeholder as the page's other policies and the custom OIDC guide. It points self-hosters to the restrictive issuer policy. ## How to verify 1. Open https://docs-git-tedd-docs-1796-supabase.vercel.app/docs/guides/auth/third-party/firebase-auth#write-rls-policies-for-firebase-users. 2. The section sits between "Add a new Third-Party Auth integration to your project" and the self-hosting restrictive policy section. 3. The SQL snippet creates a select policy on `table_name` for `authenticated` using `user_id = (select auth.jwt()->>'sub')`. 4. The text says `user_id` must be a `text` column, and to use `auth.jwt()->>'sub'` in place of `auth.uid()`, which fails with `invalid input syntax for type uuid`. 5. The text asks only self-hosters to add the restrictive issuer policy. 6. The links to the RLS guide, the `role` claim section, and the restrictive issuer policy section go to the right headings. ## Checks Ran `pnpm exec oxfmt --check` on the changed file. Checked `auth.uid()` against the `supabase/auth` migration `20220224000811_update_auth_functions.up.sql` (it casts `sub` to `uuid`), and the `sub` claim against Firebase's ID token docs. Skipped `pnpm build:guides-markdown`, which needs GitHub credentials that the build environment didn't have. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1796](https://linear.app/supabase/issue/DOCS-1796/show-how-to-write-rls-policies-that-match-the-firebase-user-id). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
c9a093fa81 |
docs(auth): show the hashed nonce in the Google pre-built HTML example (#53991)
## Problem The Google pre-built HTML example on the Google sign-in guide showed `data-nonce=""`, while the nonce step below it said the nonce must go in that attribute. Readers couldn't tell what value belongs in `data-nonce`, whether the attribute is required, or how to set a value that changes on every sign-in. Related to [FDBKIN-45945](https://linear.app/supabase/issue/FDBKIN-45945/clarify-data-nonce-attribute-in-google-login-documentation-html) Closes [DOCS-1795](https://linear.app/supabase/issue/DOCS-1795/show-where-the-hashed-nonce-goes-in-the-google-pre-built-html-example) ## Solution The HTML example now shows a `<HASHED_NONCE>` placeholder. A line below it says to keep the attribute only when you configure a nonce and to remove it otherwise, because Supabase Auth rejects a sign-in whose ID token has a nonce that `signInWithIdToken` doesn't pass (unless the nonce check is skipped). The "Configure a nonce" step now says the hashed nonce goes in `data-nonce` and the raw nonce in the `nonce` option of `signInWithIdToken`, and explains why: Supabase Auth hashes the raw value and compares it with the token's nonce. The step ends with two ways to set a per-sign-in value from code: write the `g_id_onload` element and then load the Google client script, or pass the hashed nonce to `google.accounts.id.initialize` as the Next.js example does. The nonce-generation snippet itself is unchanged. ## How to verify 1. Open https://docs-git-tedd-docs-1795-supabase.vercel.app/docs/guides/auth/social-sign-in/auth-google#google-pre-built. 2. In the "Your final HTML code might look something like this" example, `data-nonce` shows `<HASHED_NONCE>`, not an empty string. 3. Below that example, the page says to keep `data-nonce` only if you configure a nonce, to remove it otherwise, and that Supabase Auth rejects the sign-in when the ID token has a nonce and `signInWithIdToken` doesn't pass one, unless `Skip nonce check` is enabled. 4. The "Configure a nonce" step says the hashed nonce goes in `data-nonce` and the raw nonce in the `nonce` option of `signInWithIdToken`. 5. The end of that step says to generate the `data-nonce` value in page code and gives two options: write the `g_id_onload` element from code and then load the Google client script in place of the `<script>` tag from the first step, or pass the hashed nonce to `google.accounts.id.initialize`. Its "One-tap with Next.js" link jumps to that section. ## Checks Ran `pnpm exec oxfmt --check` on the changed MDX file; it passes. No code changed, so no typecheck, lint, or tests apply. Checked the hashing rule against Supabase Auth's ID-token grant (`internal/api/token_oidc.go`: SHA-256 of the raw nonce, hex-encoded, compared with the token's `nonce` claim; when the nonce check is not skipped, a token nonce without a passed nonce, or the reverse, fails with "Passed nonce and nonce in id_token should either both exist or not.") and the Google Identity Services HTML reference for `data-nonce` (optional). Did not run the docs build in the sandbox. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] I have kept the change small and focused - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [DOCS-1795](https://linear.app/supabase/issue/DOCS-1795/show-where-the-hashed-nonce-goes-in-the-google-pre-built-html-example). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
b7c1555d94 |
chore: fix order of names in humans.txt (#53982)
- fix order of names in humans.txt Co-authored-by: Alexis Aguilar <98043211+alexisintech@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> |