Closes#53584
## Problem
Two Realtime guides attach `realtime.broadcast_changes` triggers that
fire on `DELETE`:
- `apps/docs/content/guides/realtime/broadcast.mdx` —
`your_table_changes`, used by a trigger declared `AFTER INSERT OR UPDATE
OR DELETE`
- `apps/docs/content/guides/realtime/getting_started.mdx` —
`broadcast_message_changes`, used by a trigger declared `AFTER INSERT OR
UPDATE OR DELETE`
Both build the broadcast topic from the new row only:
```sql
'topic:' || NEW.id::text
'room:' || NEW.room_id::text || ':messages'
```
On `DELETE`, `NEW` is `NULL`, so the concatenation produces a `NULL`
topic. `realtime.broadcast_changes` passes that to `realtime.send`,
which inserts into `realtime.messages`. In `supabase/realtime`,
`realtime.messages.topic` is `text not null`, and `realtime.send` wraps
its insert in an exception handler that downgrades the failure to a
warning:
```sql
EXCEPTION WHEN OTHERS THEN
RAISE WARNING 'WarnSendingBroadcastMessage: %', SQLERRM;
```
So the trigger succeeds, logs only a warning, and no `DELETE` message
reaches subscribers. The sibling guide already handles this correctly:
`subscribing-to-database-changes.mdx` uses `coalesce(NEW.id, OLD.id)`.
## Fix
Use `coalesce(NEW.id, OLD.id)` in `broadcast.mdx` and
`coalesce(NEW.room_id, OLD.room_id)` in `getting_started.mdx`, matching
`subscribing-to-database-changes.mdx` so all three guides teach the same
pattern.
The `realtime.send` example in `getting_started.mdx` is unchanged
because its trigger is `AFTER INSERT` only, where `NEW` is always
present.
One caveat: `coalesce` falls back to `OLD` whenever `NEW` is null,
including an `UPDATE` that clears a nullable `room_id`. That broadcasts
to the former room, where the `CASE` form would emit a null topic and
send nothing. The example reads as if a message always belongs to a
room; for a schema where `room_id` can be cleared, use `CASE WHEN TG_OP
= 'DELETE' THEN OLD.room_id ELSE NEW.room_id END`.
## Verification
I tested the exact edited SQL blocks against
`supabase/postgres:17.6.1.143`, using the real
`realtime.broadcast_changes` and `realtime.send` definitions from
`supabase/realtime` and a `realtime.messages` table that keeps the
production `topic text not null` constraint.
Before the fix, running `INSERT`, `UPDATE`, then `DELETE` on the
`getting_started.mdx` snippet:
```text
WARNING: WarnSendingBroadcastMessage: syntax error at or near "NULL"
event | topic | op
--------+-----------------+--------
INSERT | room:7:messages | INSERT
UPDATE | room:7:messages | UPDATE
(2 rows)
```
After the fix, running insert, update body, update `room_id` to `NULL`,
move to room 9, then delete:
```text
event | topic | op | new_room | old_room
--------+-----------------+--------+----------+----------
INSERT | room:7:messages | INSERT | 7 |
UPDATE | room:7:messages | UPDATE | 7 | 7
UPDATE | room:7:messages | UPDATE | | 7
UPDATE | room:9:messages | UPDATE | 9 |
DELETE | room:9:messages | DELETE | | 9
(5 rows)
```
The `room_id` to `NULL` update follows the caveat above; `INSERT`, a
normal `UPDATE`, a room move, and `DELETE` all use the expected topic.
The `broadcast.mdx` snippet produces `INSERT`/`UPDATE`/`DELETE` messages
with `topic:<id>`.
Prettier passes on both files.
## Authorship and review
This PR is written by me. AI assisted with drafting and with setting up
the test harness, but I reviewed and audited every change myself and I
stand behind it.
## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
---------
Co-authored-by: Nik Richers <nrichers@gmail.com>
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>
## 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>
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)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added C# examples across API, authentication, database, Realtime, and
Storage guides.
* Expanded authentication coverage for passwordless, phone, anonymous,
identity linking, SSO, sign-out, and social login providers.
* Added database examples for queries, functions, joins, JSON, arrays,
search, PostGIS, and custom schemas.
* Added Realtime examples for broadcasts, presence, subscriptions, and
database changes.
* Added Storage examples for buckets, uploads, downloads,
transformations, CDN purging, and resumable transfers.
* Included C# error-handling guidance and relevant reference links.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.
YES
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Rewrote realtime guides to recommend new publishable and secret API
keys instead of legacy key guidance.
* Updated code examples (TypeScript, Flutter, Swift, Python, Dart) to
use publishable key naming.
* Simplified REST examples by removing the service-role Authorization
header and standardizing the apikey header to use a secret key.
* Improved Dashboard/API Keys navigation links and added connect dialog
query parameters.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: fadymak <dev@fadymak.com>
Co-authored-by: fadymak <fady@fadymak.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
We use the quota term for actual billing quotas, so using "Quota" as a term for configurable Realtime limits is confusing. While there are varying per-plan limits, they are not used for billing. Realtime Quotas on plans refer to Realtime Messages and Realtime Peak Connections