├── .circleci └── config.yml ├── .detoxrc.json ├── .editorconfig ├── .gitattributes ├── .github ├── pull_request_template.md └── workflows │ └── codeql-analysis.yml ├── .gitignore ├── .husky ├── .npmignore ├── commit-msg └── pre-commit ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── stripeidentityreactnative │ ├── Mappers.kt │ ├── StripeIdentityReactNativeModule.kt │ ├── StripeIdentityReactNativePackage.kt │ └── StripeIdentityVerificationSheetFragment.kt ├── babel.config.js ├── docs ├── api-reference │ ├── .nojekyll │ ├── assets │ │ ├── highlight.css │ │ ├── icons.css │ │ ├── icons.png │ │ ├── icons@2x.png │ │ ├── main.js │ │ ├── search.js │ │ ├── style.css │ │ ├── widgets.png │ │ └── widgets@2x.png │ ├── index.html │ └── modules.html └── index.html ├── e2e ├── app.e2e.js ├── config.json ├── environment.js └── utils.js ├── example ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── stripeidentityreactnative │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── stripeidentityreactnative │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── newarchitecture │ │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ │ ├── components │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ └── modules │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ ├── jni │ │ │ ├── Android.mk │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ ├── MainApplicationModuleProvider.h │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ ├── MainComponentsRegistry.cpp │ │ │ ├── MainComponentsRegistry.h │ │ │ └── OnLoad.cpp │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── File.swift │ ├── Podfile │ ├── Podfile.lock │ ├── StripeIdentityReactNativeExample-Bridging-Header.h │ ├── StripeIdentityReactNativeExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── StripeIdentityReactNativeExample.xcscheme │ ├── StripeIdentityReactNativeExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── StripeIdentityReactNativeExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m ├── metro.config.js ├── package-lock.json ├── package.json ├── src │ ├── App.tsx │ ├── assets │ │ ├── RocketRides.png │ │ ├── RocketRides@2x.png │ │ └── RocketRides@3x.png │ ├── components │ │ ├── Identity.tsx │ │ ├── Option.tsx │ │ └── Options.tsx │ ├── global.d.ts │ ├── screens │ │ └── HomeScreen.tsx │ ├── types.ts │ └── utils │ │ └── api.ts └── yarn.lock ├── ios ├── StripeIdentityReactNative-Bridging-Header.h ├── StripeIdentityReactNative.m ├── StripeIdentityReactNative.swift └── StripeIdentityReactNative.xcodeproj │ └── project.pbxproj ├── package.json ├── scripts └── publish ├── src ├── StripeIdentitySdk.tsx ├── __tests__ │ └── index.test.tsx ├── functions.ts ├── hooks │ └── useStripeIdentity.tsx ├── index.ts └── types.ts ├── stripe-identity-react-native.podspec ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | rn: react-native-community/react-native@5.6.2 5 | 6 | commands: 7 | attach_project: 8 | steps: 9 | - attach_workspace: 10 | at: ~/project 11 | 12 | jobs: 13 | install-dependencies: 14 | executor: rn/linux_js 15 | steps: 16 | - checkout 17 | - attach_project 18 | - restore_cache: 19 | keys: 20 | - dependencies-{{ checksum "package.json" }} 21 | - dependencies- 22 | - restore_cache: 23 | keys: 24 | - dependencies-example-{{ checksum "example/package.json" }} 25 | - dependencies-example- 26 | - run: 27 | name: Install dependencies 28 | command: | 29 | yarn install --cwd example --frozen-lockfile 30 | yarn install --frozen-lockfile 31 | - save_cache: 32 | key: dependencies-{{ checksum "package.json" }} 33 | paths: [node_modules] 34 | - save_cache: 35 | key: dependencies-example-{{ checksum "example/package.json" }} 36 | paths: [example/node_modules] 37 | - persist_to_workspace: 38 | root: . 39 | paths: [.] 40 | 41 | lint: 42 | executor: rn/linux_js 43 | steps: 44 | - attach_project 45 | - run: 46 | name: Lint files 47 | command: | 48 | yarn lint 49 | 50 | typescript: 51 | executor: rn/linux_js 52 | steps: 53 | - attach_project 54 | - run: 55 | name: Typecheck files 56 | command: | 57 | yarn typescript 58 | 59 | test: 60 | executor: rn/linux_js 61 | steps: 62 | - attach_project 63 | - run: 64 | name: Integration tests 65 | command: | 66 | yarn test 67 | 68 | e2e-ios: 69 | executor: 70 | name: rn/macos 71 | xcode_version: '12.4.0' 72 | steps: 73 | - attach_workspace: 74 | at: . 75 | - rn/setup_macos_executor: 76 | node_version: '14.15.0' 77 | - rn/ios_simulator_start: 78 | device: 'iPhone 11' 79 | - run: 80 | command: yarn install --frozen-lockfile 81 | name: yarn install 82 | - rn/pod_install: 83 | pod_install_directory: 'example/ios' 84 | - run: 85 | command: yarn e2e:build:ios:release 86 | name: build for detox 87 | - run: 88 | command: yarn e2e:test:ios:release 89 | name: test detox 90 | - store_artifacts: 91 | path: ./artifacts 92 | 93 | e2e-android: 94 | executor: 95 | name: rn/macos 96 | xcode_version: '12.4.0' 97 | steps: 98 | - attach_workspace: 99 | at: . 100 | - rn/setup_macos_executor: 101 | node_version: '14.15.0' 102 | - run: 103 | command: yarn install --frozen-lockfile 104 | name: yarn install 105 | - rn/android_emulator_start: 106 | logcat_grep: 'com.example.stripeterminalreactnative' 107 | platform_version: android-28 108 | - run: 109 | command: yarn e2e:build:android:release 110 | name: build for detox 111 | - run: 112 | no_output_timeout: 60m 113 | command: yarn e2e:test:android:release 114 | name: test detox 115 | - store_artifacts: 116 | path: ./artifacts 117 | 118 | workflows: 119 | build-and-test: 120 | jobs: 121 | - install-dependencies 122 | - lint: 123 | requires: 124 | - install-dependencies 125 | - typescript: 126 | requires: 127 | - install-dependencies 128 | - test: 129 | requires: 130 | - install-dependencies 131 | - e2e-android: 132 | requires: 133 | - install-dependencies 134 | - e2e-ios: 135 | requires: 136 | - install-dependencies 137 | -------------------------------------------------------------------------------- /.detoxrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "testRunner": "jest", 3 | "runnerConfig": "e2e/config.json", 4 | "apps": { 5 | "ios.debug": { 6 | "type": "ios.app", 7 | "binaryPath": "example/ios/build/Build/Products/Debug-iphonesimulator/StripeIdentityReactNativeExample.app", 8 | "build": "xcodebuild -workspace example/ios/StripeIdentityReactNativeExample.xcworkspace -configuration Debug -scheme StripeIdentityReactNativeExample -destination 'platform=iOS Simulator,name=iPhone 11' -derivedDataPath example/ios/build" 9 | }, 10 | "ios.release": { 11 | "type": "ios.app", 12 | "binaryPath": "example/ios/build/Build/Products/Release-iphonesimulator/StripeIdentityReactNativeExample.app", 13 | "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace example/ios/StripeIdentityReactNativeExample.xcworkspace -configuration Release -scheme StripeIdentityReactNativeExample -destination 'platform=iOS Simulator,name=iPhone 11' -derivedDataPath example/ios/build" 14 | }, 15 | "android.debug": { 16 | "type": "android.apk", 17 | "binaryPath": "example/android/app/build/outputs/apk/debug/app-debug.apk", 18 | "build": "cd example/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug ; cd -" 19 | }, 20 | "android.release": { 21 | "type": "android.apk", 22 | "binaryPath": "example/android/app/build/outputs/apk/release/app-release.apk", 23 | "build": "export RCT_NO_LAUNCH_PACKAGER=true && (cd example/android; ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release ; cd -)" 24 | } 25 | }, 26 | "devices": { 27 | "simulator": { 28 | "type": "ios.simulator", 29 | "device": { 30 | "type": "iPhone 11" 31 | } 32 | }, 33 | "emulator": { 34 | "type": "android.emulator", 35 | "device": { 36 | "avdName": "Nexus_6_API_29_2", 37 | "utilBinaryPaths": ["./test-butler-app.apk"] 38 | } 39 | }, 40 | "ci-emulator": { 41 | "type": "android.emulator", 42 | "device": { 43 | "avdName": "TestingAVD" 44 | }, 45 | "utilBinaryPaths": ["./test-butler-app.apk"] 46 | } 47 | }, 48 | "configurations": { 49 | "ios": { 50 | "device": "simulator", 51 | "app": "ios.debug" 52 | }, 53 | "ios.sim.release": { 54 | "device": "simulator", 55 | "app": "ios.release" 56 | }, 57 | "android": { 58 | "device": "emulator", 59 | "app": "android.debug" 60 | }, 61 | "android.emu.release": { 62 | "device": "ci-emulator", 63 | "app": "android.release" 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | 4 | # Motivation 5 | 6 | 7 | # Testing 8 | 9 | - [ ] Added tests 10 | - [ ] Modified tests 11 | - [ ] Manually verified 12 | 13 | # Screenshots 14 | | Before | After | 15 | | ------------- | ------------- | 16 | | *before screenshot* | *after screenshot* | 17 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ main ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ main ] 20 | schedule: 21 | - cron: '37 19 * * 3' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'javascript'] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v3 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v2 46 | with: 47 | languages: ${{ matrix.language }} 48 | # If you wish to specify custom queries, you can do so here or in a config file. 49 | # By default, queries listed here will override any specified in a config file. 50 | # Prefix the list here with "+" to use these queries and those in the config file. 51 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 52 | 53 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 54 | # If this step fails, then you should remove it and run the build manually (see below) 55 | - name: Autobuild 56 | uses: github/codeql-action/autobuild@v2 57 | 58 | # ℹ️ Command-line programs to run using the OS shell. 59 | # 📚 https://git.io/JvXDl 60 | 61 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 62 | # and modify them (or add more) to build your code if your project 63 | # uses a compiled language 64 | 65 | #- run: | 66 | # make bootstrap 67 | # make release 68 | 69 | - name: Perform CodeQL Analysis 70 | uses: github/codeql-action/analyze@v2 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # node.js 48 | # 49 | node_modules/ 50 | npm-debug.log 51 | yarn-debug.log 52 | yarn-error.log 53 | 54 | # BUCK 55 | buck-out/ 56 | \.buckd/ 57 | android/app/libs 58 | android/keystores/debug.keystore 59 | 60 | # Expo 61 | .expo/* 62 | 63 | # generated by bob 64 | lib/ 65 | 66 | artifacts/ 67 | -------------------------------------------------------------------------------- /.husky/.npmignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn commitlint -E HUSKY_GIT_PARAMS 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint && yarn typescript 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [v0.3.7](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.7) - 6 May 2025 2 | 3 | ### Changed 4 | 5 | - Updated `stripe-ios` to 24.13.1 6 | 7 | # [v0.3.6](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.6) - 6 May 2025 8 | 9 | ### Changed 10 | 11 | - Updated `stripe-ios` to 24.13.0 12 | 13 | # [v0.3.5](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.4) - 5 May 2025 14 | 15 | ### Changed 16 | 17 | - Updated `stripe-ios` to 24.12.1 18 | - [Fixed] Fixed an issue where identity verification may fail due to stale model cache. 19 | 20 | # [v0.3.4](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.4) - 29 Apr 2025 21 | 22 | ### Changed 23 | 24 | - Updated `stripe-ios` to 24.12.\* 25 | 26 | 27 | 28 | # [v0.3.3](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.3) - 28 Apr 2025 29 | 30 | ### Changed 31 | 32 | - Updated `stripe-ios` to 24.11.\* 33 | 34 | 35 | 36 | # [v0.3.2](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.2) - 25 Apr 2025 37 | 38 | ### Changed 39 | 40 | - Updated `stripe-ios` to 24.10.\* 41 | 42 | 43 | 44 | # [v0.3.1](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.1) - 28 Mar 2025 45 | 46 | ### Changed 47 | 48 | - Updated `stripe-ios` to 24.9.\* 49 | 50 | 51 | 52 | # [v0.3.0](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.3.0) - 24 Mar 2025 53 | 54 | ### Changed 55 | 56 | - Updated `stripe-ios` to 24.8.\* 57 | 58 | 59 | 60 | # [v0.2.18](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.2.18) - 11 Mar 2025 61 | 62 | ### Changed 63 | 64 | - Replaced unreliable boost dependency url 65 | 66 | 67 | 68 | # [v0.2.17](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.2.17) - 10 Mar 2025 69 | 70 | ### Changed 71 | 72 | - Updated `stripe-ios` to 24.7.\* 73 | 74 | 75 | 76 | # [v0.2.16](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.2.16) - 24 Jan 2025 77 | 78 | ### Changed 79 | 80 | - Updated `stripe-ios` to 24.4.\* 81 | 82 | 83 | 84 | # [v0.2.14](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.2.14) - 02 December 2024 85 | 86 | ### Changed 87 | 88 | - Updated `stripe-ios` to 24.1.\* 89 | - Updated `stripe-android` to 20.52.\* 90 | 91 | 92 | 93 | # [v0.2.13](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.2.13) - 19 July 2024 94 | 95 | ### Changed 96 | 97 | - Updated `stripe-ios` to 23.28.\* 98 | - Updated `stripe-android` to 20.48.\* 99 | 100 | 101 | 102 | # [v0.1.8](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.8) - 15 May 2023 103 | 104 | ### Changed 105 | 106 | - Update Android to 20.25.+ and iOS to 23.8.+ 107 | 108 | [Changes][v0.1.8] 109 | 110 | 111 | 112 | # [v0.1.7](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.7) - 03 May 2023 113 | 114 | 115 | 116 | 117 | > Note: This version is compatible with `stripe-react-native` [0.27.1](https://github.com/stripe/stripe-react-native/releases/tag/v0.27.1) if your app uses both SDKs 118 | 119 | ### New features 120 | 121 | - Support test mode in iOS and Android 122 | 123 | [Changes][v0.1.7] 124 | 125 | 126 | 127 | # [v0.1.6](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.6) - 27 Apr 2023 128 | 129 | [Changes][v0.1.6] 130 | 131 | 132 | 133 | # [v0.1.5](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.5) - 25 Mar 2023 134 | 135 | Bump up iOS native SDK version to `~> 23.5.0` 136 | 137 | [Changes][v0.1.5] 138 | 139 | 140 | 141 | # [v0.1.4](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.4) - 09 Mar 2023 142 | 143 | - Support [ID](https://stripe.com/docs/identity/verification-checks?type=id-number) & [Address](https://stripe.com/docs/identity/verification-checks?type=address) verification. 144 | - Use latest native iOS SDK from version 23.4.2 145 | - Update Android Kotlin version to 1.8.0 and agp to 7.2.2 146 | 147 | [Changes][v0.1.4] 148 | 149 | 150 | 151 | # [v0.1.2](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.2) - 13 Jan 2023 152 | 153 | Use latest native iOS SDK from version 23.3.0 154 | 155 | ### Fixes 156 | 157 | [96](https://github.com/stripe/stripe-identity-react-native/pull/96) use the latest native iOS 158 | 159 | [Changes][v0.1.2] 160 | 161 | 162 | 163 | # [v0.1.1](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.1) - 14 Sep 2022 164 | 165 | Fixing an Android bug when StripeIdentityReactNativeModule is registered but not used. 166 | 167 | ### Fixes 168 | 169 | [88](https://https://github.com/stripe/stripe-identity-react-native/pull/88) Null check encapsulated fragment for StripeIdentityReactNativeModule for Android 170 | 171 | [Changes][v0.1.1] 172 | 173 | 174 | 175 | # [Initial release stripe-identity-react-native (v0.1.0)](https://github.com/stripe/stripe-identity-react-native/releases/tag/v0.1.0) - 19 Apr 2022 176 | 177 | Initial release for version `v0.1.0` 178 | 179 | [Changes][v0.1.0] 180 | 181 | [v0.1.8]: https://github.com/stripe/stripe-identity-react-native/compare/v0.1.7...v0.1.8 182 | [v0.1.7]: https://github.com/stripe/stripe-identity-react-native/compare/v0.1.6...v0.1.7 183 | [v0.1.6]: https://github.com/stripe/stripe-identity-react-native/compare/v0.1.5...v0.1.6 184 | [v0.1.5]: https://github.com/stripe/stripe-identity-react-native/compare/v0.1.4...v0.1.5 185 | [v0.1.4]: https://github.com/stripe/stripe-identity-react-native/compare/v0.1.2...v0.1.4 186 | [v0.1.2]: https://github.com/stripe/stripe-identity-react-native/compare/v0.1.1...v0.1.2 187 | [v0.1.1]: https://github.com/stripe/stripe-identity-react-native/compare/v0.1.0...v0.1.1 188 | [v0.1.0]: https://github.com/stripe/stripe-identity-react-native/tree/v0.1.0 189 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. 4 | 5 | ## Development workflow 6 | 7 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: 8 | 9 | ```sh 10 | yarn 11 | ``` 12 | 13 | > While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development. 14 | 15 | While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app. 16 | 17 | To start the packager: 18 | 19 | ```sh 20 | yarn example start 21 | ``` 22 | 23 | To run the example app on Android: 24 | 25 | ```sh 26 | yarn example android 27 | ``` 28 | 29 | To run the example app on iOS: 30 | 31 | ```sh 32 | yarn example ios 33 | ``` 34 | 35 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 36 | 37 | ```sh 38 | yarn typescript 39 | yarn lint 40 | ``` 41 | 42 | To fix formatting errors, run the following: 43 | 44 | ```sh 45 | yarn lint --fix 46 | ``` 47 | 48 | Remember to add tests for your change if possible. Run the unit tests by: 49 | 50 | ```sh 51 | yarn test 52 | ``` 53 | 54 | To edit the Objective-C files, open `example/ios/StripeIdentityReactNativeExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > stripe-identity-react-native`. 55 | 56 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `stripeidentityreactnative` under `Android`. 57 | 58 | ### Commit message convention 59 | 60 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 61 | 62 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 63 | - `feat`: new features, e.g. add new method to the module. 64 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 65 | - `docs`: changes into documentation, e.g. add usage example for the module.. 66 | - `test`: adding or updating tests, e.g. add integration tests using detox. 67 | - `chore`: tooling changes, e.g. change CI config. 68 | 69 | Our pre-commit hooks verify that your commit message matches this format when committing. 70 | 71 | ### Linting and tests 72 | 73 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 74 | 75 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. 76 | 77 | Our pre-commit hooks verify that the linter and tests pass when committing. 78 | 79 | ### Scripts 80 | 81 | The `package.json` file contains various scripts for common tasks: 82 | 83 | - `yarn typescript`: type-check files with TypeScript. 84 | - `yarn lint`: lint files with ESLint. 85 | - `yarn test`: run unit tests with Jest. 86 | - `yarn example start`: start the Metro server for the example app. 87 | - `yarn example android`: run the example app on Android. 88 | - `yarn example ios`: run the example app on iOS. 89 | 90 | ### Sending a pull request 91 | 92 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). 93 | 94 | When you're sending a pull request: 95 | 96 | - Prefer small pull requests focused on one change. 97 | - Verify that linters and tests are passing. 98 | - Review the documentation to make sure it looks good. 99 | - Follow the pull request template when opening a pull request. 100 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 101 | 102 | ## Code of Conduct 103 | 104 | ### Our Pledge 105 | 106 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 107 | 108 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 109 | 110 | ### Our Standards 111 | 112 | Examples of behavior that contributes to a positive environment for our community include: 113 | 114 | - Demonstrating empathy and kindness toward other people 115 | - Being respectful of differing opinions, viewpoints, and experiences 116 | - Giving and gracefully accepting constructive feedback 117 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 118 | - Focusing on what is best not just for us as individuals, but for the overall community 119 | 120 | Examples of unacceptable behavior include: 121 | 122 | - The use of sexualized language or imagery, and sexual attention or 123 | advances of any kind 124 | - Trolling, insulting or derogatory comments, and personal or political attacks 125 | - Public or private harassment 126 | - Publishing others' private information, such as a physical or email 127 | address, without their explicit permission 128 | - Other conduct which could reasonably be considered inappropriate in a 129 | professional setting 130 | 131 | ### Enforcement Responsibilities 132 | 133 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 134 | 135 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 136 | 137 | ### Scope 138 | 139 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 140 | 141 | ### Enforcement 142 | 143 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. 144 | 145 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 146 | 147 | ### Enforcement Guidelines 148 | 149 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 150 | 151 | #### 1. Correction 152 | 153 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 154 | 155 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 156 | 157 | #### 2. Warning 158 | 159 | **Community Impact**: A violation through a single incident or series of actions. 160 | 161 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 162 | 163 | #### 3. Temporary Ban 164 | 165 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 166 | 167 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 168 | 169 | #### 4. Permanent Ban 170 | 171 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 172 | 173 | **Consequence**: A permanent ban from any sort of public interaction within the community. 174 | 175 | ### Attribution 176 | 177 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 178 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 179 | 180 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 181 | 182 | [homepage]: https://www.contributor-covenant.org 183 | 184 | For answers to common questions about this code of conduct, see the FAQ at 185 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 186 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Mateusz Skwierczyński 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stripe Identity React Native SDK 2 | 3 | Stripe Identity enables online businesses to securely verify the identities of users around the world. Robust identity verification helps prevent fraud, simplify compliance, and increase trust. Stripe will use biometric technology (on images of you and your IDs) and other data sources. With the Stripe Identity React Native SDK, you can confidently verify the authenticity of ID documents from over 33 countries in your React Native application. 4 | 5 | > To get access to the Identity React Native SDK, visit the [Identity Settings](https://dashboard.stripe.com/settings/identity) page and click **Enable**. 6 | 7 | ## Getting started 8 | 9 | Get started with our [📚 integration guides](https://stripe.com/docs/identity/verify-identity-documents?platform=react-native) and [example project](#run-the-example-app). 10 | 11 | > Updating to a newer version of the SDK? See our [changelog](https://github.com/stripe/stripe-identity-react-native/blob/main/CHANGELOG.md). 12 | 13 | ## Features 14 | 15 | **Simplified security**: We've made it simple for you to securely collect your user's personally identifiable information (PII) such as identity document images. Sensitive PII data is sent directly to Stripe Identity instead of passing through your server. For more information, see our [integration security guide](https://stripe.com/docs/security). 16 | 17 | **Automatic document capture**: We automatically capture images of the front and back of government-issued photo ID to ensure a clear and readable image. 18 | 19 | **Prebuilt UI**: We provide [`IdentityVerificationSheet`](https://stripe.dev/stripe-ios/stripe-identity/Classes/IdentityVerificationSheet.html), a prebuilt UI that combines all the steps required to collect ID documents, selfies, and ID numbers into a single sheet that displays on top of your app. 20 | 21 | **Automated verification**: Stripe Identity's automated verification technology looks for patterns to help determine if an ID document is real or fake and uses distinctive physiological characteristics of faces to match your users' selfies to photos on their ID document. Collected identity information is checked against a global set of databases to confirm that it exists. Learn more about the [verification checks supported by Stripe Identity](https://stripe.com/docs/identity/verification-checks), [accessing verification results](https://stripe.com/docs/identity/access-verification-results), or our integration guide on [handling verification outcomes](https://stripe.com/docs/identity/handle-verification-outcomes). 22 | 23 | ### Requirements 24 | 25 | The SDK uses TypeScript features available in Babel version `7.9.0` and above. 26 | Alternatively use the `plugin-transform-typescript` plugin in your project. 27 | 28 | #### Android 29 | - Compatible with Android 5.0 (API level 21) and above. 30 | - Stripe Identity requires the hosting activity to use material theme. To enable material theme: 31 | - Open your project's `app/src/main/AndroidManifest.xml`. 32 | - Make sure the `android:theme` applied to the `application` is a child of one of the material themes(e.g `Theme.MaterialComponents.DayNight`). 33 | > See more details about material theme [here](https://material.io/develop/android/theming/dark). 34 | 35 | #### iOS 36 | > Note: [Xcode 13 is no longer supported by Apple](https://developer.apple.com/news/upcoming-requirements/). Please upgrade to Xcode 14.1 or later. 37 | 38 | - Compatible with apps targeting iOS 13.0 or above. 39 | - Run `pod install` in your `ios` directory to ensure that you also install the required native dependencies. 40 | - Stripe Identity requires access to the device’s camera to capture identity documents. To enable your app to request camera permissions: 41 | - Open your project’s `Info.plist`. 42 | - Add the `NSCameraUsageDescription` key. 43 | - Add a string value that explains to your users why your app requires camera permissions(e.g `This app uses the camera to take a picture of your identity documents.`). 44 | 45 | ## Usage example 46 | 47 | Get started with our [📚 integration guides](https://stripe.com/docs/identity/verify-identity-documents?platform=react-native) and [example project](#run-the-example-app), or [📘 browse the SDK reference](https://stripe.dev/stripe-identity-react-native). 48 | 49 | To initialize Stripe Identity SDK in your React Native app, use the `useStripeIdentity` hook in the screen where you want to use it. 50 | 51 | First you need a server-side endpoint to [create the VerificationSession](https://stripe.com/docs/api/identity/verification_sessions/create) and ephemeral key secret, then you can send a POST request to create verification session: 52 | 53 | ```ts 54 | const fetchVerificationSessionParams = async () => { 55 | try { 56 | const data = await fetch( 57 | `${YOUR_SERVER_BASE_URL}/create-verification-session`, 58 | { 59 | method: 'POST', 60 | headers: { 61 | 'Content-Type': 'application/json', 62 | }, 63 | body: {}, 64 | } 65 | ); 66 | const json = await data.json(); 67 | return json; 68 | } catch (e) { 69 | return {}; 70 | } 71 | }; 72 | ``` 73 | 74 | Once you get options you can use `useStripeIdentity` passing fetchOptions to it. 75 | 76 | ```tsx 77 | // HomeScreen.tsx 78 | import { useStripeIdentity } from '@stripe/stripe-identity-react-native'; 79 | import logo from './assets/logo.png'; 80 | 81 | function HomeScreen() { 82 | const fetchOptions = async () => { 83 | const response = await fetchVerificationSessionParams(); 84 | 85 | return { 86 | sessionId: response.id, 87 | ephemeralKeySecret: response.ephemeral_key_secret, 88 | brandLogo: Image.resolveAssetSource(logo), 89 | }; 90 | }; 91 | 92 | const { status, present, loading } = useStripeIdentity(fetchOptions); 93 | 94 | const handlePress = useCallback(() => { 95 | present(); 96 | }, [present]); 97 | 98 | const renderButton = useCallback(() => { 99 | if (loading) { 100 | return ; 101 | } 102 | return