feat: add TanStack Start integration - #603
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@drankou is attempting to deploy a commit to the ory Team on Vercel. A member of the Team first needs to authorize it. |
|
|
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #603 +/- ##
===========================================
+ Coverage 42.43% 61.77% +19.34%
===========================================
Files 136 190 +54
Lines 2008 4013 +2005
Branches 288 677 +389
===========================================
+ Hits 852 2479 +1627
- Misses 1149 1384 +235
- Partials 7 150 +143
🚀 New features to boost your workflow:
|
What this adds
@ory/tanstack-start— server helpers and request middleware for rendering@ory/elements-reactin TanStack Start applications, plus a runnable example app (examples/tanstack-start).createOry(options)returns request-scoped server helpers:getLoginFlow,getRegistrationFlow,getRecoveryFlow,getVerificationFlow,getSettingsFlow,getLogoutFlow,getSession,getError, andgetBrowserSdkUrl.createOryMiddleware(options)proxies Ory's browser endpoints (/self-service,/sessions/whoami,/ui,/.ory,/.well-known/ory) through the application origin so cookies stay first-party on cross-site setups — the same role as@ory/nextjs's middleware, implemented on standard FetchRequest/Responseobjects.Design notes
@ory/nextjs's App Router surface. Redirects are thrown TanStackredirect()s (303) so they serialize across the server-function boundary, and flow getters returnPromise<Flow>rather than a nullable union.createServerFnwrappers stay in application source because the TanStack compiler transforms them there; the package exposes portable({ request, params })helpers instead. The README documents the pattern, including the/_serverFnauthentication-gate pitfall.sdkUrl, optionalserverSdkUrlfor a private Ory upstream,appUrl,projectApiToken) rather than env-var based, since TanStack Start has noNEXT_PUBLIC_convention.getSessionreturnsnullonly on 401 and rethrows other failures, so infrastructure errors don't render as logged-out users.1.170.0/ Start1.168.0— the oldest release set the package's tests and build are verified against. The example pins an aged, soaked release set (1.170.18/1.168.32).Testing
api-extractorreport is included and CI-checked./auth/login303s into the Ory browser flow).🤖 Generated with Claude Code