Skip to content

fix(expo): Pass proxyUrl through to the native component SDKs - #9373

Open
wobsoriano wants to merge 9 commits into
mainfrom
rob/expo-native-proxy-url
Open

fix(expo): Pass proxyUrl through to the native component SDKs#9373
wobsoriano wants to merge 9 commits into
mainfrom
rob/expo-native-proxy-url

Conversation

@wobsoriano

Copy link
Copy Markdown
Member

Description

The native components ignored the proxyUrl passed to <ClerkProvider>. The bridge configure() call only forwarded the publishable key, so clerk-ios and clerk-android derived the Frontend API origin from the key and called it directly. On proxy-configured instances that domain may not serve a certificate, so native components failed at TLS while the JS auth path worked.

configure() now carries proxyUrl across the bridge into Clerk.Options(proxyUrl:) on iOS and ClerkConfigurationOptions(proxyUrl = ...) on Android. Bootstrap and reconfigure are keyed on publishable key plus proxy URL, and both sides of the bridge ship together, so there is no version-skew risk.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 718a067

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/expo Patch

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

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Aug 17, 2026 7:52pm
swingset Ready Ready Preview Aug 17, 2026 7:52pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9373

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9373

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9373

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9373

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9373

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9373

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9373

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9373

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9373

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9373

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9373

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9373

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9373

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9373

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9373

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9373

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9373

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9373

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9373

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9373

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9373

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9373

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9373

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9373

commit: 718a067

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: ae790248-7620-4b5b-9149-458310bd02a1

📥 Commits

Reviewing files that changed from the base of the PR and between 3b760de and 461b776.

📒 Files selected for processing (1)
  • packages/expo/ios/ClerkNativeBridge.swift
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/clerk-ios (auto-detected)
  • clerk/cli (auto-detected)
  • clerk/clerk-android (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/expo/ios/ClerkNativeBridge.swift

Included review availability: 6 reviews are currently available. Based on recent review activity, included reviews refill at 10 per hour.


📝 Walkthrough

Walkthrough

Expo native configuration now accepts an optional proxyUrl. ClerkProvider passes it to useNativeClientBootstrap and updated native module contracts. Android and iOS normalize, store, and apply the proxy URL during initial configuration and reconfiguration. Synchronization tests cover proxy forwarding and legacy fallback behavior. A patch changeset documents the release.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 461b7

The change forwards the configured proxy URL to native authentication components; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: forwarding proxyUrl from Expo to native component SDKs.
Description check ✅ Passed The description directly explains the proxyUrl bridge changes and their effect on native SDK configuration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-08-17T19:52:24.907Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 718a067.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/expo/src/provider/nativeClientSync.tsx (1)

1025-1080: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Set native readiness only after configuration succeeds.

Line 1025 sets didAttemptConfigure before ClerkExpo.configure() resolves. If the native bridge rejects, Line 1080 still marks this configuration as ready. NativeClientSync can then run while the native SDK still uses the previous proxy configuration.

Set the success flag after ClerkExpo.configure() resolves.

Proposed fix
-            let didAttemptConfigure = false;
+            let didConfigure = false;
...
-            didAttemptConfigure = true;
             await ClerkExpo.configure(publishableKey, initialJsDeviceToken, nativeProxyUrl);
+            didConfigure = true;
...
-          if (didAttemptConfigure && isCurrentConfiguration()) {
+          if (didConfigure && isCurrentConfiguration()) {
             setReadyConfigKey(configuringConfigKey);
           }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/expo/src/provider/nativeClientSync.tsx` around lines 1025 - 1080,
Move the `didAttemptConfigure = true` assignment in the configuration flow to
immediately after `await ClerkExpo.configure(...)` resolves successfully. Keep
the `finally` readiness update guarded by `didAttemptConfigure` and
`isCurrentConfiguration()` so failed configuration attempts cannot mark the
native configuration as ready.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx`:
- Around line 196-209: Add rerender coverage to the native ClerkProvider
synchronization tests around the existing proxyUrl test: update proxyUrl, then
remove it, and await each synchronization before asserting. Verify native
configure receives the updated URL and the normalized null value, with each
expected configuration applied once and in order.

---

Outside diff comments:
In `@packages/expo/src/provider/nativeClientSync.tsx`:
- Around line 1025-1080: Move the `didAttemptConfigure = true` assignment in the
configuration flow to immediately after `await ClerkExpo.configure(...)`
resolves successfully. Keep the `finally` readiness update guarded by
`didAttemptConfigure` and `isCurrentConfiguration()` so failed configuration
attempts cannot mark the native configuration as ready.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: bfa7c768-e12c-4560-b118-aee0da42b1f8

📥 Commits

Reviewing files that changed from the base of the PR and between 8c61153 and 54c14a5.

📒 Files selected for processing (10)
  • .changeset/expo-native-proxy-url.md
  • packages/expo/android/src/main/java/expo/modules/clerk/ClerkExpoModule.kt
  • packages/expo/ios/ClerkExpoModule.swift
  • packages/expo/ios/ClerkNativeBridge.swift
  • packages/expo/src/provider/ClerkProvider.tsx
  • packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx
  • packages/expo/src/provider/nativeClientSync.tsx
  • packages/expo/src/specs/NativeClerkModule.android.ts
  • packages/expo/src/specs/NativeClerkModule.ts
  • packages/expo/src/utils/native-module.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/cli (auto-detected)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)

…-url

# Conflicts:
#	packages/expo/android/src/main/java/expo/modules/clerk/ClerkExpoModule.kt
#	packages/expo/src/provider/nativeClientSync.tsx
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant