Skip to content

Conversation

@chriscanin
Copy link
Member

@chriscanin chriscanin commented Jan 22, 2026

Description

  • Make publishableKey a required prop since env vars in node_modules aren't inlined in production builds
  • Fixes issue reported by Kadi regarding TestFlight/Google Play crashes

https://linear.app/clerk/issue/MOBILE-393/remove-env-var-fallback-require-publishablekey-prop

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:

Summary by CodeRabbit

  • Breaking Changes
    • publishableKey prop on ClerkProvider is now required (previously optional).
    • Environment variable fallbacks are no longer used — you must provide the publishableKey explicitly at configuration time.
    • Migration: update app initialization to pass the publishableKey directly to ClerkProvider from your app configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

🦋 Changeset detected

Latest commit: b23a007

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 Major

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
Copy link

vercel bot commented Jan 22, 2026

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

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 22, 2026 10:18pm

Request Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 22, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7655

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7655

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: b23a007

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

This pull request makes the publishableKey prop required on ClerkProvider and removes runtime environment-variable fallbacks. The provider and related initialization no longer read EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY/CLERK_PUBLISHABLE_KEY; instead the key must be passed explicitly. The default publishable key used during singleton initialization was changed from environment-variable fallbacks to an empty string. A changeset documents this breaking change and includes migration guidance.

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: making publishableKey required and removing environment variable fallbacks, which aligns with the core modification across all three files.
Linked Issues check ✅ Passed The pull request implementation fully addresses MOBILE-393 objectives by making publishableKey required in ClerkProviderProps and removing all environment variable fallbacks from both ClerkProvider and createClerkInstance.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective of making publishableKey required and removing environment variable fallbacks; no unrelated modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

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/singleton/createClerkInstance.ts (1)

30-40: Add regression tests for required publishableKey behavior.

This is a breaking change removing env fallbacks; please add/adjust tests to cover missing-key errors and instance reuse to prevent regressions before merge. As per coding guidelines, add tests for this change.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants