Skip to content

feat(checkout): add useIdentityVerificationCredentials hook to react and react-native - #2020

Merged
AngelPaella merged 1 commit into
angel/react-native-identity-verificationfrom
angelcalderaro/eng4-373-add-useidentityverificationcredentials-hook-to-the-react-and
Aug 12, 2026
Merged

feat(checkout): add useIdentityVerificationCredentials hook to react and react-native#2020
AngelPaella merged 1 commit into
angel/react-native-identity-verificationfrom
angelcalderaro/eng4-373-add-useidentityverificationcredentials-hook-to-the-react-and

Conversation

@AngelPaella

Copy link
Copy Markdown
Contributor

Closes ENG4-373

getIdentityVerificationCredentials was the only camelCase non-hook export in either UI package, so merchants plumbed the order themselves:

const { order } = useCrossmintCheckout();
const credentials = getIdentityVerificationCredentials(order);

Each package now has a hook that reads the checkout context, so a merchant writes one line at the single call site where they wire the external-KYC flow:

const credentials = useIdentityVerificationCredentials();

The plain function stays exported. react-ui@4.4.0 already ships it, and it works on any order object (a server fetch, a webhook payload, the server SDK) where a hook cannot run. The hook calls it.

Notes

Verification

  • pnpm turbo build on both packages. The hook lands in each dist/index.d.ts returning IdentityVerificationCredentials | undefined.
  • pnpm generate:docs on both. The generated checkout hooks page includes the hook with its JSDoc description and example.
  • pnpm turbo test:vitest on client-sdk-base, react-ui and react-native-ui: 41 tests pass.

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 65d34a0

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

This PR includes changesets to release 7 packages
Name Type
@crossmint/client-sdk-react-ui Minor
@crossmint/client-sdk-react-native-ui Minor
@crossmint/auth-ssr-nextjs-demo Patch
@crossmint/client-sdk-nextjs-starter Patch
@crossmint/wallets-quickstart-devkit Patch
@crossmint/wallets-playground-react Patch
@crossmint/wallets-playground-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

@AngelPaella
AngelPaella marked this pull request as ready for review August 12, 2026 19:35
@AngelPaella
AngelPaella merged commit bc17d69 into angel/react-native-identity-verification Aug 12, 2026
6 checks passed
@AngelPaella
AngelPaella deleted the angelcalderaro/eng4-373-add-useidentityverificationcredentials-hook-to-the-react-and branch August 12, 2026 19:35
@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
packages/client/ui/react-native/examples.json:75-78
**Documentation mixed with implementation**

These user-facing examples are bundled with the hook implementation, preventing the feature and documentation from being reviewed, reverted, or released independently. Repository policy requires documentation changes to be submitted in a separate pull request; the same pattern also occurs in the React example and the rewritten React Native identity-verification example.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(checkout): add useIdentityVerificat..." | Re-trigger Greptile

Comment on lines +75 to +78
"useIdentityVerificationCredentials": {
"code": "import {\n CrossmintIdentityVerification,\n useIdentityVerificationCredentials,\n} from \"@crossmint/client-sdk-react-native-ui\";\n\nfunction VerificationStep() {\n const credentials = useIdentityVerificationCredentials();\n\n if (credentials == null) {\n return null;\n }\n\n return (\n <CrossmintIdentityVerification\n credentials={credentials}\n onComplete={({ status }) => console.log(status)}\n />\n );\n}",
"language": "tsx"
},

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.

P2 Documentation mixed with implementation

These user-facing examples are bundled with the hook implementation, preventing the feature and documentation from being reviewed, reverted, or released independently. Repository policy requires documentation changes to be submitted in a separate pull request; the same pattern also occurs in the React example and the rewritten React Native identity-verification example.

Rule Used: Documentation changes should be separated into the... (source)

Learned From
Paella-Labs/crossbit-main#20976

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/client/ui/react-native/examples.json
Line: 75-78

Comment:
**Documentation mixed with implementation**

These user-facing examples are bundled with the hook implementation, preventing the feature and documentation from being reviewed, reverted, or released independently. Repository policy requires documentation changes to be submitted in a separate pull request; the same pattern also occurs in the React example and the rewritten React Native identity-verification example.

**Rule Used:** Documentation changes should be separated into the... ([source](https://app.greptile.com/crossmint/-/custom-context?memory=ce1a162d-c5de-43f7-a3c8-fc554e479bf6))

**Learned From**
[Paella-Labs/crossbit-main#20976](https://github.com/Paella-Labs/crossbit-main/pull/20976)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

AngelPaella added a commit that referenced this pull request Aug 13, 2026
…#2019)

* feat(react-native): add CrossmintIdentityVerification

* feat(react-native): export identity verification credentials helper

* feat(checkout): accept identityVerificationHandling on react-native

* refactor(react-native): drop speculative memo and height reset from identity verification

* fix(react-native): enable DOM storage for the identity verification WebView

* fix(react-native): report failed identity verification loads through onError

* feat(checkout): add useIdentityVerificationCredentials hook to react and react-native (#2020)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant