Files
anthony lio c2292c97f2 fix(docs): shared account menu (#53620)
## Problem

- docs menu keeps its own copy of the account items, separate from the
shared top nav menu that #53558 adds for kb
- docs header waits for auth, so a signed-out reader sees "Sign up"
appear after load and the header shifts

## Solution

- moves the docs desktop account menu onto the shared top nav menu, so
docs and kb show the same account items and sign out
- changes the shared menu button to show the avatar of the reader or a
person icon when there is no avatar, so kb gets the avatar too
- changes the docs "Sign up" link and the menu button to read that mark
while auth loads so the header is correct at first paint

<!--
## 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. open
[/docs/guides/getting-started](https://docs-git-antlio-fix-docs-shared-account-menu-supabase.vercel.app/docs/guides/getting-started)
with the network set to "Slow 4G" in devtools
2. make sure that "Sign up" shows on the first frame and that the header
does not shift when the page finishes loading
3. make sure that the browser console shows no react error 418
4. open the browser console on the preview, and run this snippet, which
stores a fake dashboard session with no real token:
   ```js
const user = { id: 'test', aud: 'authenticated', email:
'you@example.com', user_metadata: { avatar_url:
'https://github.com/supabase.png' } }
   const key = 'supabase.dashboard.auth.token'
localStorage.setItem(key, JSON.stringify({ access_token: 'a.b.c',
refresh_token: 'r', token_type: 'bearer', expires_in: 3600, expires_at:
Math.floor(Date.now() / 1000) + 3600, user }))
   localStorage.setItem(`${key}-user`, JSON.stringify({ user }))
5. reload the page

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-24 16:08:54 +02:00
..

Supabase Knowledge Base

This directory contains the Astro app for the Supabase Knowledge Base, served at supabase.com/kb.

Content is organized into 4 collections:

  • src/content/guides/: hand-written guides in Markdown or MDX, grouped by topic.
  • src/content/faqs/: short answers to common questions.
  • src/data/community-guides.json: Highlights other valuable, written resources from our Supabase community. Includes metadata on other written resources (URLs, titles, descriptions, and topics) so we can list these on topics pages.
  • src/content/troubleshooting/: troubleshooting guides fetched from a private repo at build time (see below).

At build time, every page is also exported as a plain .md file, so the content can be read by LLM crawlers and other tools. Requests that send Accept: text/markdown receive these files directly.

Search is served by an API route in api/search/, backed by content indexed with pnpm search:ingest.

What belongs in /kb versus /docs

  • /kb owns applied decisions and applied experience. If the answer depends on factors outside the product (scale, budget, the existing stack, or the alternatives), it belongs in /kb.
  • /docs owns product truth. If Supabase alone determines the answer, it belongs in /docs. This includes API and SDK reference, configuration, product concepts, quickstarts, supported behavior and limits, and setup for a single integration.
Content type Include Exclude
guides Comparisons, migrations from other platforms, decision guides, and tutorials where the cross-stack choice is the point Single-product setup or reference that /docs already covers. Link to /docs for that material instead.
faqs Short answers to "Can I use Supabase for X?" or "Can I use X with Supabase?" questions, where the answer depends on the user's stack or workload Yes/no product facts (supported SDKs, limits, pricing). Answer these in /docs.
community-guides Useful external write-ups from the community that we only link to. Any content that we host ourselves.
troubleshooting Fixes for problems, for example in response to Support tickets N/A

Tip: Before you add a page, search /docs, /kb, and /blog for an existing answer. If one exists, improve it and then decide if it should move or you should link to it. Avoid duplicating content.

Development

Run the dev server from the repository root or from apps/kb. It starts at http://localhost:3008/kb.

pnpm dev:kb   # from the root
pnpm dev      # from apps/kb

Other commands, run from apps/kb:

Command Action
pnpm build Build the production site
pnpm preview Preview the build locally
pnpm test Run unit tests (vitest)

To write or edit guides, and for details on the Markdown export and routing, see AGENTS.md.

Federated troubleshooting content

src/content/troubleshooting/ isn't hand-written — it's fetched from a private repo by scripts/federated-content/fetch-federated-content.ts as part of the build (the fetch:federated-content task in turbo.jsonc) and is gitignored. See AGENTS.md for how it works and what's intentionally left out for now.

Contributing to troubleshooting articles

Troubleshooting articles (/kb/troubleshooting/...) aren't open for direct contributions. They go through an internal review process before they're published.

Note

You can still suggest a fix, comment on the article's GitHub Discussion (linked at the bottom of each article as "Go to the GitHub discussion"), or open an issue that links the article and describes the change. Pull requests for other /kb content, such as src/content/guides/, are welcome.

Style guide

In general, follow all the existing guidelines in the Docs Style Guide.

Additionally, stick to plain GitHub-Flavored Markdown:

  • No custom/JSX components in guide bodies — content is also exported as plain .md (see below), and a component wouldn't survive that export.
  • For callouts, use GitHub's native alert syntax (> [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION]) — the build renders these into the Admonition component for you (src/lib/mdx/rehype-admonitions.ts). Don't import or use Admonition directly in content.
  • Frontmatter requires title, but see src/content.config.ts for the full schema.

Workflows

.github/workflows/kb-troubleshooting-sync.yml runs on pushes to master that touch apps/kb/** (or can be triggered manually): it fetches troubleshooting content, creates a GitHub Discussion for any guide that doesn't have one yet (sync:troubleshooting-entries), and pushes title/content updates to discussions whose guide has since changed (sync:troubleshooting-updates). This is separate from kb's own build — it has real side effects (creating/updating Discussions, writing DB rows), so it never runs as part of pnpm build.

Tests

Unit tests (vitest) live next to the code they cover, including the search API (api/search/_search.test.ts; the _ prefix keeps Vercel from deploying it as a function). Run them from apps/kb:

pnpm test

.github/workflows/kb-tests.yml runs them on pull requests that touch apps/kb.

Functional smoke tests (Playwright) live in e2e/kb and cover the key /kb journeys: home → topic → guide, troubleshooting articles, the markdown export (.md and Accept: text/markdown), and the search API (production only, since previews don't have search configured). They run against production by default. Install the browser once, then run from the repository root:

pnpm -C e2e/kb exec playwright install chromium
pnpm e2e:kb

# Against a preview or local build
PLAYWRIGHT_BASE_URL=https://<preview-url> pnpm e2e:kb

.github/workflows/kb-e2e.yml runs the smoke tests on pull requests against the PR's Vercel kb preview (or production, when only e2e/kb changed), and daily against production. Run it manually with a base_url to test any other deployment.