The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: drop stale alpha labels from server and middleware reference (#51494)
Katerina Skroumpeloud303c248d352
diff --git a/apps/docs/docs/ref/middleware/introduction.mdx b/apps/docs/docs/ref/middleware/introduction.mdxindex ba9b97cfff0..6d235bb6e7a 100644--- a/apps/docs/docs/ref/middleware/introduction.mdx+++ b/apps/docs/docs/ref/middleware/introduction.mdx@@ -7,12 +7,6 @@ title: IntroductionEach middleware can guard the request, edit the response, or contribute typed values to a shared context that later middleware and your handler read. TypeScript checks the composition: a middleware that needs a value from an earlier middleware will not compile unless that middleware runs first.-<Admonition type="caution" title="Alpha">--`@supabase/middleware` is in alpha. APIs may change between 0.x releases.--</Admonition>-This package contains the engine and the framework-neutral middleware: `withCors` and `withFeatureFlag`. Supabase-specific middleware such as `withClaims`, `withSupabaseClient`, `withSupabaseAdminClient`, `withPostgresClient`, and `withPostgresAdminClient` ships in [`@supabase/server`](/docs/reference/server/introduction).### Trust modeldiff --git a/apps/docs/docs/ref/middleware/usage-examples.mdx b/apps/docs/docs/ref/middleware/usage-examples.mdxindex 4a557683d32..d302ff4b4b0 100644--- a/apps/docs/docs/ref/middleware/usage-examples.mdx+++ b/apps/docs/docs/ref/middleware/usage-examples.mdx@@ -53,7 +53,7 @@ Each example builds one Fetch handler with `pipeline`. Entries run in array ordeWithout `withCors`, `withSupabase` answers every `OPTIONS` request itself with `204` and wildcard CORS headers (`Access-Control-Allow-Origin: *`). That is enough when you do not need an origin allowlist. A layer that owns CORS must sit before `withSupabase` in the array. Placed after it, the preflight reaches the auth gate and gets a `401`.- The entry form of `withSupabase` is alpha. It needs `@supabase/server` 1.6.0 or later.+ The entry form of `withSupabase` needs `@supabase/server` 1.6.0 or later.</RefSubLayout.Details>diff --git a/apps/docs/docs/ref/server/frameworks.mdx b/apps/docs/docs/ref/server/frameworks.mdxindex 46260d7dc8d..49fdcf7dee9 100644--- a/apps/docs/docs/ref/server/frameworks.mdx+++ b/apps/docs/docs/ref/server/frameworks.mdx@@ -5,12 +5,14 @@ title: Frameworks`@supabase/server` middleware runs inside Hono, H3, Elysia, NestJS, and TanStack Start through a bridge: one file you copy into your project. The bridge runs a `@supabase/middleware` entry array in the framework's own middleware slot. Your route handlers then read `supabase`, `jwtClaims`, and any other key the entries contribute from the place your framework keeps per-request state.-The framework adapters (`@supabase/server/adapters/*`) predate the middleware engine. We are moving off them, and they will be deprecated soon. The bridges on this page replace them. If you use an adapter today, read "Moving off the adapters" below before you change anything. One step in that migration can open an endpoint up without an error.+The framework adapters (`@supabase/server/adapters/*`) predate the middleware engine. They are deprecated and will be removed on December 1, 2026. The bridges on this page replace them. If you use an adapter today, read [Moving off the adapters](/docs/reference/server/frameworks#moving-off-the-adapters) before you change anything. One step in that migration can open an endpoint up without an error.<Admonition type="note" title="Versions">The bridges need `@supabase/server` 1.6.0 or later and Node 22 or later. `withRequiredClaims` shipped in 1.5.1 and the entry form of `withSupabase` in 1.6.0. Releases before 1.5.1 have no `/middleware/*` exports.+The bridge file imports `@supabase/middleware`, so add it to your project as a direct dependency. `@supabase/server` depends on it, but a strict package manager such as pnpm does not let your code import a transitive dependency.+</Admonition>### What a bridge gives you@@ -268,7 +270,7 @@ The bridge files live in the server repository under [`examples/frameworks`](httEach adapter solved the same problem in a framework-specific way: build a `SupabaseContext` and stash it where the handler can reach it. That meant a published entry point, a peer dependency range, and a release cycle per framework, all to wrap one call. The engine replaced the model. A middleware is now an entry, a `(handler) => handler` wrapper over the Web `Request` and `Response` pair, and `withSupabaseClient()`, `withSupabaseAdminClient()`, `withRequiredClaims()`, and the rest are ordinary entries you compose. What remains is the bridge, and it belongs in your project, not in a package that has to track your framework's major versions.-The adapters still work in v1 and will be deprecated soon. They will be removed in a future major. `withSupabase(config, handler)` from `@supabase/server` is not part of this change.+The adapters are deprecated. They still work today and will be removed on December 1, 2026. `withSupabase(config, handler)` from `@supabase/server` is not part of this change.Three changes come with the migration. The first can open an endpoint up.@@ -329,7 +331,7 @@ Neither entry answers a CORS preflight, and the short-circuits carry no CORS hea`withSupabase(config, handler)` still does the verify-then-reject work for you, and it is not deprecated. It wraps a fetch handler rather than composing into a framework chain, so it does not slot into a bridge. If an endpoint is already a plain fetch handler, staying on `withSupabase()` is a legitimate end state. It is also the only way to get the full `SupabaseContext`, `userClaims` and `authMode` included, behind an auth gate.-To compose other entries around it, `withSupabase({ auth: 'user' })` with no handler is a `pipeline` entry placed by position. Entries before it run ahead of the auth gate. Entries after it receive the full `SupabaseContext`. Nesting, as in `withSupabase(config, entry(handler))`, still works. The entry form is alpha and needs 1.6.0 or later.+To compose other entries around it, `withSupabase({ auth: 'user' })` with no handler is a `pipeline` entry placed by position. Entries before it run ahead of the auth gate. Entries after it receive the full `SupabaseContext`. Nesting, as in `withSupabase(config, entry(handler))`, still works. The entry form needs 1.6.0 or later.```tsimport { pipeline } from '@supabase/middleware'@@ -458,6 +460,7 @@ Do the steps in order. The auth inventory comes before any code change, because<RefSubLayout.Examples>```bash+ npm install @supabase/middlewaremkdir -p src/libcurl --fail -o src/lib/supabase-middleware.ts \https://raw.githubusercontent.com/supabase/server/main/examples/frameworks/hono/supabase-middleware.ts@@ -614,7 +617,8 @@ contributes jwtClaims: null and falls through, turning a 401 endpoint into aauth: 'user'. Never compose withClaims() and withRequiredClaims() together;they share the jwtClaims key and that is a compile-time conflict.-STEP 3: FETCH THE BRIDGE. Download+STEP 3: FETCH THE BRIDGE. Add @supabase/middleware as a direct dependency of+the project; the bridge imports it. Then downloadhttps://raw.githubusercontent.com/supabase/server/main/examples/frameworks/hono/supabase-middleware.tsand save it as src/lib/supabase-middleware.ts, verbatim. Do not "improve",condense, or drop comments from it.diff --git a/apps/docs/spec/reference/server/v1/partials/frameworks.mdx b/apps/docs/spec/reference/server/v1/partials/frameworks.mdxindex 3e29ea0d870..49fdcf7dee9 100644--- a/apps/docs/spec/reference/server/v1/partials/frameworks.mdx+++ b/apps/docs/spec/reference/server/v1/partials/frameworks.mdx@@ -5,7 +5,7 @@ title: Frameworks`@supabase/server` middleware runs inside Hono, H3, Elysia, NestJS, and TanStack Start through a bridge: one file you copy into your project. The bridge runs a `@supabase/middleware` entry array in the framework's own middleware slot. Your route handlers then read `supabase`, `jwtClaims`, and any other key the entries contribute from the place your framework keeps per-request state.-The framework adapters (`@supabase/server/adapters/*`) predate the middleware engine. They are deprecated and will be removed on December 1, 2026. The bridges on this page replace them. If you use an adapter today, read "Moving off the adapters" below before you change anything. One step in that migration can open an endpoint up without an error.+The framework adapters (`@supabase/server/adapters/*`) predate the middleware engine. They are deprecated and will be removed on December 1, 2026. The bridges on this page replace them. If you use an adapter today, read [Moving off the adapters](/docs/reference/server/frameworks#moving-off-the-adapters) before you change anything. One step in that migration can open an endpoint up without an error.<Admonition type="note" title="Versions">diff --git a/apps/ui-library/content/docs/headless/mcp.mdx b/apps/ui-library/content/docs/headless/mcp.mdxindex de2910c3059..78a064f2271 100644--- a/apps/ui-library/content/docs/headless/mcp.mdx+++ b/apps/ui-library/content/docs/headless/mcp.mdx@@ -96,10 +96,8 @@ and hosted; off Edge Functions pass `resourceServer` and `authorizationServer`.OAuth access tokens. OAuth tokens include `client_id`; ordinary product sessionsdo not. The included `whoami` tool exposes that difference.-Composing `withSupabase` as a `pipeline` entry is alpha in `@supabase/server`-and tracks `@supabase/middleware` 0.x. The nested form,-`withOAuthProtectedResource(withSupabase(config, handleMcp))`, is stable and-behaves the same.+Composing `withSupabase` as a `pipeline` entry needs `@supabase/server` 1.6.0+or later.Any holder of a valid user token can call this function directly. Treat itstools as an authenticated product API: keep RLS enabled, check authorization for