Files
Danny White 30a1b38da0 feat(studio): rename temporary access to database token access (#54282)
## Problem

The database access preview still uses “Temporary access” across its
settings and member rules.

## Solution

Use “Database token access” for the feature and “Member access” for
member rules. Update the preview, settings, dialogs, feedback, member
status messages and docs together. Move the guide to
`/guides/platform/token-access`, permanently redirect the old URL, and
preserve existing section anchors.

## Review instructions

1. Open [the Studio
preview](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app),
then Feature previews and find **Database token access**. Enable the
preview for a supported project, then open [Database
Settings](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app/project/_/database/settings).
2. Check the **Database token access** heading, **Allow token access**
switch and **Member access** table. Open **Add rule** and an existing
rule to check the sheet titles. Open a rule’s delete confirmation and
cancel it.
3. With an assigned role, check the access status above the member
table. As a member without management permission, check the access
notice uses the same feature name.
4. Open the [database token access guide in the docs
preview](https://docs-git-dnywh-database-token-access-naming-supabase.vercel.app/docs/guides/platform/token-access).
Check the guide and navigation use the new name, the dashboard
instructions match Studio, and the existing section links from the
member guide still work. Open `/docs/guides/platform/temporary-access`
and its `.md` variant to check they permanently redirect to the new
URLs.

| Before | After |
| --- | --- |
| <img width="726" height="367" alt="CleanShot 2026-11-30 at 16 06 00"
src="https://github.com/user-attachments/assets/be351f0c-d578-4289-8785-5c4e69a254a7"
/> | <img width="729" height="374" alt="CleanShot 2026-11-30 at 16 05
38"
src="https://github.com/user-attachments/assets/f02b470d-ef1a-4b6c-bdbb-20fe10b847c6"
/> |
2026-12-02 00:03:43 +00:00
..

Docs redirects

Redirects for /docs URLs live here. Before this folder existed, most of them were in apps/www/lib/redirects.js, because www serves the docs zone through a rewrite.

Both files use full public paths, including the /docs prefix (for example /docs/guides/...).

File Contains Served by
static-redirects.json One-to-one mappings: a fixed source maps to a fixed destination, with no params, splats, regex, or has/missing. Source only. Hand-edited.
generated/static-redirects-md-variants.json Build output: static-redirects.json plus the generated .md variants. Gitignored. Vercel bulk redirects, through bulkRedirectsPath in apps/docs/vercel.json
dynamic-redirects.js Anything with conditional logic: :param, * / :path* splats, regex groups, has, or missing. Next.js redirects() in apps/docs/next.config.mjs

Dev and preview only redirects (/, /dashboard/*, /blog/*) are in a separate section at the end of dynamic-redirects.js.

Adding a redirect

  1. If it has no params, splats, regex, or conditions, add it to static-redirects.json. Otherwise add it to dynamic-redirects.js.

  2. In static-redirects.json, use the same shape as the existing entries:

    { "source": "/docs/guides/old-path", "destination": "/docs/guides/new-path", "permanent": true }
    

    Do not add a .md entry by hand. The generator creates it for every /docs/guides/ entry.

  3. To preview the Vercel file locally, run:

    pnpm run redirects:generate
    

    The build (redirects:generate is a turbo dependency of build) regenerates it on every deploy, so do not commit it.

  4. In dynamic-redirects.js, include basePath: false, because the sources are full public paths and Next must not add /docs again. .md variants for /docs/guides/ entries are generated in next.config.mjs, so do not add them here:

    {
      basePath: false,
      permanent: true,
      source: '/docs/guides/old-path/:slug',
      destination: '/docs/guides/new-path/:slug',
    },
    
  5. Use permanent: true for permanent (308) redirects and permanent: false for temporary (307) redirects.

  6. JSON does not support comments, so put the reason for a static entry in the PR description.

  7. Keep each source unique within its file.

  8. Run pnpm test in apps/docs to confirm that next.config.mjs still loads.

Generator

scripts/generate-static-redirects-md-variants.mjs builds generated/static-redirects-md-variants.json from static-redirects.json:

  • It adds a .md variant for every /docs/guides/ entry with a string destination.
  • It fails if a hand-written .md entry conflicts with a generated variant, or if a source is duplicated.
  • It groups each base entry with its .md variant, base first, and sorts the groups by base path.

The generator runs as a turbo dependency of build, so an invalid source fails the build before anything deploys. The output is gitignored, so generated redirects do not appear in PR diffs. Run pnpm run redirects:generate to review them.

Notes

  • Bulk redirects ignore Next's basePath, which is why the JSON uses the /docs prefix.
  • .md variants for dynamic /docs/guides/ entries are generated at runtime in next.config.mjs. Static variants are generated by the script into generated/static-redirects-md-variants.json.
  • apps/www runs its own redirects before it rewrites /docs to this app. Where the same source exists in both places, the www rule wins. /docs/guides/database/inspect is one case: www sends it to /docs/guides/observability/inspect, and the docs config used to send it to /docs/guides/monitoring-and-debugging/inspect. This folder keeps the www destination.