Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2d729d2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughAdds exported predicate shouldAutoProxy(hostname: string) to the shared package (matches 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Comment |
…omains Add automatic FAPI proxying detection for Vercel preview deployments across all SDKs. When an app is deployed to a .vercel.app subdomain without explicit proxy/domain configuration, the SDK automatically routes FAPI requests through the app's own domain via /__clerk proxy path. - Add isVercelPreviewDeploy() helper in @clerk/shared/proxy - Auto-detect in clerk-js proxyUrl getter for client-side SDK initialization - Auto-detect in @clerk/backend authenticateContext for server-side auth - Enable proxy interception in Next.js middleware for /__clerk/* requests on .vercel.app - Add comprehensive tests for all three layers (shared, backend, clerk-js, nextjs) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
f73bc85 to
dbc580e
Compare
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/tiny-badgers-smile.md:
- Line 8: Update the changeset description sentence that currently reads "Add
auto-proxy detection for eligible hosts and generalize the internal helper
naming for future providers." to be specific about which hosts are considered
eligible (e.g., Vercel preview deployments) and to clarify the helper change;
for example, change the description to: "Add auto-proxy detection for Vercel
preview deployments (.vercel.app subdomains) and generalize the internal helper
for future hosting providers." Locate and edit the line containing that
description in the changeset (the sentence beginning "Add auto-proxy detection
for eligible hosts...") and replace it with the clearer, user-facing wording.
- Around line 1-6: The changeset incorrectly marks package bumps as 'patch' but
a new public API (shouldAutoProxy) was added; update the entries so any package
that exports the new function (at least '@clerk/shared', and any packages that
re-export it like '@clerk/backend', '@clerk/clerk-js', '@clerk/nextjs' if
applicable) use 'minor' instead of 'patch' in the
.changeset/tiny-badgers-smile.md file; ensure the header lines for those package
entries read 'minor' to reflect the new public API bump while keeping other
metadata unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0cecde51-9659-43c2-8677-37774a033a71
📒 Files selected for processing (1)
.changeset/tiny-badgers-smile.md
| --- | ||
| '@clerk/backend': patch | ||
| '@clerk/clerk-js': patch | ||
| '@clerk/nextjs': patch | ||
| '@clerk/shared': patch | ||
| --- |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check if shouldAutoProxy is a public export
# Search for shouldAutoProxy exports in the shared package
rg -n "export.*shouldAutoProxy" packages/shared/Repository: clerk/javascript
Length of output: 152
Update version bumps from patch to minor to reflect the new public API export.
The changeset marks all packages for patch bumps, but the PR introduces a new public API function shouldAutoProxy exported from @clerk/shared. Per semantic versioning standards, new public APIs require minor version bumps, not patch (which is reserved for bug fixes). Update the changeset accordingly.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.changeset/tiny-badgers-smile.md around lines 1 - 6, The changeset
incorrectly marks package bumps as 'patch' but a new public API
(shouldAutoProxy) was added; update the entries so any package that exports the
new function (at least '@clerk/shared', and any packages that re-export it like
'@clerk/backend', '@clerk/clerk-js', '@clerk/nextjs' if applicable) use 'minor'
instead of 'patch' in the .changeset/tiny-badgers-smile.md file; ensure the
header lines for those package entries read 'minor' to reflect the new public
API bump while keeping other metadata unchanged.
| '@clerk/shared': patch | ||
| --- | ||
|
|
||
| Add auto-proxy detection for eligible hosts and generalize the internal helper naming for future providers. |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider making the description more specific for end users.
The description mentions "eligible hosts" without specifying what makes a host eligible. Since changeset descriptions appear in changelogs, consider being more explicit to help users understand when auto-proxy detection activates.
For example: "Add auto-proxy detection for Vercel preview deployments (.vercel.app subdomains) and generalize the internal helper for future hosting providers."
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 8-8: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.changeset/tiny-badgers-smile.md at line 8, Update the changeset description
sentence that currently reads "Add auto-proxy detection for eligible hosts and
generalize the internal helper naming for future providers." to be specific
about which hosts are considered eligible (e.g., Vercel preview deployments) and
to clarify the helper change; for example, change the description to: "Add
auto-proxy detection for Vercel preview deployments (.vercel.app subdomains) and
generalize the internal helper for future hosting providers." Locate and edit
the line containing that description in the changeset (the sentence beginning
"Add auto-proxy detection for eligible hosts...") and replace it with the
clearer, user-facing wording.
Description
This PR implements automatic FAPI proxying for Vercel preview deployments. When an app is deployed to a
.vercel.appsubdomain without explicit proxy or domain configuration, the SDK automatically routes FAPI requests through the app's own domain via the/__clerkproxy path.The auto-detection is centralized across all SDKs:
@clerk/shared/proxy): NewisVercelPreviewDeploy()helper detects.vercel.apphostnames@clerk/clerk-js): Auto-detect inproxyUrlgetter whenwindow.location.hostnameis.vercel.app@clerk/backend): Auto-detect inauthenticateContextconstructor when request hostname is.vercel.app@clerk/nextjs): Auto-enable proxy interception for/__clerk/*requests on.vercel.apphostnamesGuard conditions prevent auto-detection when explicit configuration is provided:
proxyUrl,domain, or environment variablesNEXT_PUBLIC_CLERK_PROXY_URL/NEXT_PUBLIC_CLERK_DOMAIN.Test Results
@clerk/shared: 981/981 tests passed@clerk/backend: 1114/1114 tests passed@clerk/clerk-js: 624/624 tests passed@clerk/nextjs: 362 tests passed (49 pre-existing failures unrelated to this change)Build verification: All packages build cleanly with no type errors.
Checklist
pnpm testruns as expectedpnpm buildruns as expectedType of change
Summary by CodeRabbit
New Features
Tests