-
Notifications
You must be signed in to change notification settings - Fork 431
fix(expo): Make publishableKey prop required and remove env var fallb… #7655
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
base: main
Are you sure you want to change the base?
fix(expo): Make publishableKey prop required and remove env var fallb… #7655
Conversation
🦋 Changeset detectedLatest commit: b23a007 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@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/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: |
…uire-publishablekey-prop
📝 WalkthroughWalkthroughThis pull request makes the 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
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.
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 requiredpublishableKeybehavior.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.
| "@clerk/expo": major | ||
| --- | ||
|
|
||
| fix(expo): Make publishableKey prop required and remove env var fallbacks |
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.
| fix(expo): Make publishableKey prop required and remove env var fallbacks | |
| The `publishableKey` prop is now required in `ClerkProvider`. Previously, the prop was optional and would fall back to `EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY` or `CLERK_PUBLISHABLE_KEY` environment variables. | |
| Environment variables inside `node_modules` are not inlined during production builds in React Native/Expo, which could cause apps to crash in production when the publishable key is undefined. | |
| You must now explicitly pass the `publishableKey` prop to `ClerkProvider`: | |
| ```tsx | |
| const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY!; | |
| <ClerkProvider publishableKey={publishableKey}> | |
| {/* Your app */} | |
| </ClerkProvider> |
wobsoriano
left a comment
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.
Looking good! Let's provide a clear migration instruction
Description
https://linear.app/clerk/issue/MOBILE-393/remove-env-var-fallback-require-publishablekey-prop
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
publishableKeyprop on ClerkProvider is now required (previously optional).✏️ Tip: You can customize this high-level summary in your review settings.