Skip to content

docs: add typechecked framework bridges for middleware entries - #168

Merged
mandarini merged 4 commits into
mainfrom
docs/framework-bridges
Sep 29, 2026
Merged

mandarini merged 4 commits into
mainfrom
docs/framework-bridges

Conversation

@mandarini

@mandarini mandarini commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Adds examples/frameworks/ with a copyable, typechecked bridge and a minimal app for Hono, H3, Elysia, NestJS, and TanStack Start. Each bridge runs a @supabase/middleware entry array inside the framework's own middleware slot, folds the pipeline once so entries keep their state across requests, and fails to compile at the call site on duplicate keys or missing prerequisites. A new typecheck:examples script runs in CI and lint covers the folder. Nothing ships to npm, and the root package gains no dependency: examples/package.json is a private pnpm workspace package that holds what only the examples need (@tanstack/react-start and its React peers). Verified with typecheck, lint, the unit suite, negative compile cases, a runtime script that drives the Hono, H3, and Elysia bridges with real requests, and a runtime check of the TanStack Start body buffering. Tomás's five-app suite in supabase/server-examples produced the round-two findings this PR folds in: Nest CORS and body limits, Hono per-route scoping, and the TanStack Start bridge as a repo file. The guide that explains the bridges and the adapter migration is supabase/supabase#50514; tracked in SDK-1599.

Blocks: supabase/supabase#50514

@pkg-pr-new

pkg-pr-new Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@supabase/server@168

commit: 7baca95

Comment thread examples/frameworks/elysia/supabase-middleware.ts Outdated
@mandarini
mandarini force-pushed the docs/framework-bridges branch from 0410bb4 to 7baca95 Compare September 29, 2026 12:17
@mandarini
mandarini merged commit f3a0e3c into main Sep 29, 2026
10 checks passed
@mandarini
mandarini deleted the docs/framework-bridges branch September 29, 2026 12:23
mandarini added a commit to supabase/supabase that referenced this pull request Sep 29, 2026
Adds a Frameworks partial to the `@supabase/server` reference, after
Installing. It explains how to run `@supabase/middleware` entries inside
Hono, H3, Elysia, NestJS, and TanStack Start through a copyable bridge,
and how to move off the framework adapters: the auth trap
(`withRequiredClaims` versus `withClaims`), the `userClaims` to
`jwtClaims` field remap, how each framework scopes an entry array to a
group of routes, what CORS and body access cost on NestJS, the
step-by-step procedure, and a prompt to hand to a coding agent. The
bridge code for all five frameworks lives in supabase/server#168 and is
linked, not copied. Resolves
[SDK-1599](https://linear.app/supabase/issue/SDK-1599) and
[SDK-1862](https://linear.app/supabase/issue/SDK-1862): the retired
`withSupabase({ middleware })` form is gone from the text.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Added integration guidance and setup examples for Hono, H3/Nuxt,
Elysia, NestJS, and TanStack Start, including framework-specific
context, response, and route-scoping behavior.
* Documented migration options for authentication requirements, changes
to context and JWT claims, and differences in response and error
handling.
* Added a TanStack Start bridge example and migration and verification
checklists.
  * Added the frameworks guide to the API reference navigation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants