feat(react-native): expose appId prop on CrossmintProvider for bare RN support#1608
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
feat(react-native): expose appId prop on CrossmintProvider for bare RN support#1608devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
…N support The CrossmintProvider previously auto-detected the app bundle ID exclusively via expo-constants (Constants.expoConfig). In bare React Native projects without Expo, this value is undefined, causing the x-app-identifier header to never be sent. This results in 403 errors: 'Client-side API key requires an origin header'. This change exposes appId as an optional prop on CrossmintProviderProps, falling back to the existing Expo auto-detection when not provided.
🦋 Changeset detectedLatest commit: b47aec7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
Contributor
Author
Original prompt from Guillegit clone git@github.com:Paella-Labs/paella-os.git |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bare React Native (non-Expo) projects using a mobile client-side API key get a 403 error:
Root cause:
CrossmintProviderauto-detects the app bundle ID exclusively viaConstants.expoConfig, which isundefinedin bare RN. This means thex-app-identifierheader is never sent, and the server falls through to the webOriginheader check — which native HTTP clients don't provide.Fix: Expose
appIdas an optional prop onCrossmintProviderProps(already defined inCrossmintConfig), with fallback to the existing Expo auto-detection. Fully backward-compatible — Expo users are unaffected.Discovered while investigating a customer issue (alemx.com) where their iOS app was getting 403s on the email OTP endpoint.
Link to Devin Session: https://crossmint.devinenterprise.com/sessions/69fe83c455a54198a34899eff208e383
Requested by: @xmint-guille
Test plan
BaseCrossmintProviderwhich already handlesappIdCrossmintConfig.appIdis alreadyoptional(it is — seepackages/common/base/src/types/Crossmint.ts:26)BaseCrossmintProvideralready accepts and forwardsappIdto the API clientPackage updates
@crossmint/client-sdk-react-native-ui— patch bump via changeset (cyan-fireants-perform.md)