Skip to content

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

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

fix(expo): Pass proxyUrl through to the native component SDKs#9373
wobsoriano wants to merge 5 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: 67389dc

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 10, 2026 4:20pm
swingset Ready Ready Preview Aug 10, 2026 4:20pm

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: 67389dc

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 4548d123-efe1-46cb-8c73-9281e2e44dbb

📥 Commits

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

📒 Files selected for processing (8)
  • .changeset/expo-native-proxy-url.md
  • packages/expo/android/src/main/java/expo/modules/clerk/ClerkExpoModule.kt
  • packages/expo/ios/ClerkExpoModule.swift
  • 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)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/expo-native-proxy-url.md
  • packages/expo/src/provider/tests/ClerkProvider.nativeClientSync.test.tsx

📝 Walkthrough

Walkthrough

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

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

Suggested reviewers: mikepitre

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: passing proxyUrl through the Expo native bridge.
Description check ✅ Passed The description accurately explains the proxy forwarding fix, compatibility behavior, and affected native SDKs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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-10T16:21:56.635Z

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 67389dc.

@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)

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