Skip to content

KYC: Feature - SumSub SDK integration#2165

Draft
cmgustavo wants to merge 1 commit into
bitpay:developfrom
cmgustavo:feat/sumsub-sdk-integration-01
Draft

KYC: Feature - SumSub SDK integration#2165
cmgustavo wants to merge 1 commit into
bitpay:developfrom
cmgustavo:feat/sumsub-sdk-integration-01

Conversation

@cmgustavo

@cmgustavo cmgustavo commented May 11, 2026

Copy link
Copy Markdown
Member

Testing Instructions

Prerequisites

Environment variable — add to .env.development or .env.production for production:

SUMSUB_LEVEL_NAME=<level name from SumSub dashboard, e.g. basic-kyc-level>

Dev token — if the backend endpoint /api/v2/sumsub/token is not yet available, generate a token manually:

# Fill in APP_TOKEN, SECRET_KEY, USER_ID and LEVEL_NAME in the script
node scripts/get-sumsub-token.js
# Copy the output and paste it into src/api/sumsub/index.ts → SUMSUB_DEV_TOKEN

SUMSUB_DEV_TOKEN must be left empty before merging.

Start:

yarn install; yarn pod:install; yarn set:dev; yarn start
npx react-native run-android

Test Cases

1. Home Banner Entry Point

  • Log in with an TEST account that has no KYC completed
  • Email should be verified
  • Verify the identity verification banner appears on the Home screen (KycBannerGate)
  • Tap the banner → should navigate to the verification flow

2. Settings Entry Point

  • Go to Settings → Security
  • Verify a "KYC Verification" option is present (KycVerification screen in SecurityGroup)
  • Tap it → should navigate to the same verification flow

3. Profile Entry Point

  • Go to Profile Settings (ProfileSettings)
  • Verify the VerifyIdentity screen is accessible from the BitpayIdGroup navigator

4. SDK Launch & Permissions (iOS)

  • Start the verification flow from any entry point
  • The SumSub SDK should open as a native overlay
  • Verify the following permission prompts appear:
    • Camera — "…scan QR codes and verify your identity"
    • Microphone — "…identity verification"
    • Photo Library — "…upload identity documents"

5. Happy Path

  • Complete the verification flow using SumSub sandbox test documents
  • On approval → the SDK should close automatically
  • Verify the sumsub Redux slice is updated correctly
  • Verify the Home banner no longer appears (or shows a "verified" state)

6. Token Refresh

  • Simulate token expiration during the flow (or wait for the 600s TTL)
  • The SDK should silently request a new token via the onTokenExpired callback
  • The verification flow should continue without visible interruption

7. Cancellation / Error

  • Cancel the SDK before completing the flow
  • Verify the app returns to the previous screen without crashing
  • Verify the Redux store is not left in an intermediate state

8. Denied Permissions (iOS)

  • Deny camera permission before starting the flow
  • Verify the SDK handles the error gracefully (no crash, user-facing message expected)

Unit Tests

yarn jest --testPathPattern=sumsub

The @sumsub/react-native-mobilesdk-module is mocked at test/mocks/sumsubSdkMock.js. Tests for sumsub.effects.ts covers:

  • auth guard (missing user / apiToken)
  • access token retrieval + SDK launch wiring
  • mapping the SDK result status into SUMSUB.kycStatus
  • the "Failed" status path (error modal, no status persisted)
  • non-verification statuses being ignored
  • SDK errors being swallowed (effect resolves)

Notes

  • On Android, verify the SumSub maven repository resolves correctly during build (maven.sumsub.com).
  • SUMSUB_DEV_TOKEN in src/api/sumsub/index.ts must be empty before this PR is merged.

@cmgustavo cmgustavo force-pushed the feat/sumsub-sdk-integration-01 branch 3 times, most recently from ccdbe11 to 69c9860 Compare May 12, 2026 20:27
@cmgustavo cmgustavo changed the title SumSub: Feature - first sdk integration KYC: Feature - SumSub SDK integration May 15, 2026
@cmgustavo cmgustavo force-pushed the feat/sumsub-sdk-integration-01 branch 5 times, most recently from 9c14d4a to bd34d72 Compare May 21, 2026 13:28
@cmgustavo cmgustavo force-pushed the feat/sumsub-sdk-integration-01 branch from bd34d72 to 9726f26 Compare May 22, 2026 13:09
@cmgustavo cmgustavo force-pushed the feat/sumsub-sdk-integration-01 branch 7 times, most recently from cbbeb76 to 586b5e2 Compare June 5, 2026 14:06
@cmgustavo cmgustavo force-pushed the feat/sumsub-sdk-integration-01 branch from 586b5e2 to cdf165a Compare June 5, 2026 14:07
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