-
Notifications
You must be signed in to change notification settings - Fork 449
feat(*): auto-proxy for eligible hosts #8035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
brkalow
wants to merge
35
commits into
main
Choose a base branch
from
brkalow/auto-proxy-vercel-subdomains
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
70420c0
feat(shared,backend,clerk-js,nextjs): Auto-proxy for .vercel.app subd…
brkalow dbc580e
refactor: generalize auto proxy naming
brkalow 2d729d2
chore(repo): add changeset for auto proxy updates
brkalow 72d6bdc
feat(shared,nextjs): support vercel production static auto proxy
brkalow f8906d3
fix(shared): make proxy helpers server safe
brkalow 217a991
fix(nextjs): use nextUrl for auto proxy detection
brkalow db5ee3f
fix(shared,nextjs): proxy initial script tags
brkalow c99aba2
fix(backend): prevent Content-Encoding mismatch in proxy responses
brkalow aea3966
fix: add Vercel env vars to turbo.json and harden proxy header stripping
brkalow 675270a
refactor(backend): convert RESPONSE_HEADERS_TO_STRIP to a Set
brkalow 24d68e3
merge: resolve conflicts with main
Railly bdc8436
chore: add changeset for auto-proxy feature
Railly 9a2f6b7
fix(shared): guard shouldAutoProxy against undefined hostname
Railly b89156d
chore: remove duplicate changeset
Railly 0b6db2b
fix: only auto-proxy for production instances on .vercel.app
Railly 96842db
refactor: export AUTO_PROXY_PATH and replace hardcoded /__clerk
Railly 635c9b7
refactor(nextjs): inline auto-proxy detection in middleware for reada…
Railly 0859708
test(clerk-js): add dev instance guard test, use production key for a…
Railly 67475c6
fix(nextjs): add production-only guard to middleware auto-proxy detec…
Railly b3e8273
fix(nextjs): hoist requestUrl declaration to fix ReferenceError with …
Railly 66a8ad1
test(backend): fix auto-proxy tests to use pkLive, add dev key negati…
Railly cba7dfd
fix(backend): document X-Forwarded-Host trust assumption in auto-proxy
Railly c9c28b0
fix(shared): wrap normalizeHostname URL parsing in try-catch
Railly 2371ab2
refactor: use isProductionFromPublishableKey instead of raw pk_live_ …
Railly a492681
Merge remote-tracking branch 'origin/main' into brkalow/auto-proxy-ve…
Railly 670d2af
fix(nextjs): use production key in middleware auto-proxy tests, resto…
Railly 0024932
style: restore keyless-provider.tsx formatting from main
Railly 174ed67
style: restore UserSettings.ts formatting from main
Railly a4091ad
Merge remote-tracking branch 'origin/main' into brkalow/auto-proxy-ve…
Railly 06bce1d
style: restore merge artifact formatting from main
Railly 4d7c662
chore: remove stale test-signin-provider file
Railly e0a275d
docs(shared): add comment explaining build-time/runtime dual executio…
Railly 43be86f
refactor(backend): use getAutoProxyUrlFromEnvironment instead of head…
Railly d7feb1c
fix(backend): remove unused AUTO_PROXY_PATH import
Railly d0450ed
Merge remote-tracking branch 'origin/main' into brkalow/auto-proxy-ve…
Railly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| '@clerk/shared': patch | ||
| '@clerk/backend': patch | ||
| '@clerk/clerk-js': patch | ||
| '@clerk/nextjs': patch | ||
| --- | ||
|
|
||
| Auto-proxy FAPI requests for `.vercel.app` subdomains. When deployed to a `.vercel.app` domain without explicit proxy or domain configuration, the SDK automatically routes Frontend API requests through `/__clerk` on the app's own origin. This enables Clerk production mode on Vercel deployments without manual proxy setup. |
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: A possible extra test here is to check that it doesn't break when
windowis not defined (for native envs).The
if (inBrowser()) {already takes care of it, but tests are always nice.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in
0859708, also updated existing tests to use production key since auto-proxy is now production-only