Add configureClient() to intercept framework fetch requests - #112
Open
JoviDeCroock wants to merge 3 commits into
Open
Add configureClient() to intercept framework fetch requests#112JoviDeCroock wants to merge 3 commits into
JoviDeCroock wants to merge 3 commits into
Conversation
JoviDeCroock
force-pushed
the
claude/investigate-auth-header-loaders-JYfVh
branch
2 times, most recently
from
April 18, 2026 08:41
2856ba3 to
906a2bb
Compare
JoviDeCroock
force-pushed
the
claude/investigate-auth-header-loaders-JYfVh
branch
5 times, most recently
from
July 7, 2026 17:16
f1d5c94 to
09b2b07
Compare
Introduces configureClient({ fetch }) so apps can install a custom fetch
used by every framework-initiated client request: route-state fetches on
navigation, useRevalidate, prefetch, and <Form> submissions. Enables
forwarding an Authorization header (e.g. a bearer token held on the
client) so server-side loaders can read it from request.headers on both
the initial SSR request and every subsequent client-triggered fetch.
JoviDeCroock
force-pushed
the
claude/investigate-auth-header-loaders-JYfVh
branch
from
July 9, 2026 05:26
09b2b07 to
c497d16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
configureClient({ fetch })API that allows apps to install a custom fetch implementation for all framework-initiated client requests. This enables forwarding auth headers (e.g.Authorization: Bearer …) to loaders on client-side navigations, revalidations, prefetches, and<Form>submissions without losing them after initial SSR.The custom fetch is routed through:
<Form>submissionsThis is particularly useful for bearer token-based auth where the token is stored on the client and must be attached to every request, unlike session cookies which flow automatically.
Testing
configure-client.test.ts) covering:fetchPrachtRouteStatefetch: undefinedis passed<Form>submission routing through custom fetchpnpm testpassesChecklist
configureClient,ConfigureClientOptions,PrachtClientFetch)https://claude.ai/code/session_0159U8Fz9HjrYH6iFYfJYFpT