{"_id":"@blacktomang/expo-aws-liveness","_rev":"2-9883cd347cf7b6a7d9134ef1d4b32693","name":"@blacktomang/expo-aws-liveness","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@blacktomang/expo-aws-liveness","version":"0.1.0","keywords":["react-native","expo","aws","amplify","liveness","rekognition"],"author":{"name":"Syam"},"license":"MIT","_id":"@blacktomang/expo-aws-liveness@0.1.0","maintainers":[{"name":"blacktomang","email":"blacktomang@gmail.com"}],"dist":{"shasum":"6d8ad79677eadf2e5eaa03e34d95ab9fec02f706","tarball":"https://registry.npmjs.org/@blacktomang/expo-aws-liveness/-/expo-aws-liveness-0.1.0.tgz","fileCount":27,"integrity":"sha512-DxTUtbP7DN0w2GJZJpCkUi8EdkSj8PZX0b9sx3suY47ZtgxdSh6/n0mft/3hxfgDDFSyICia7vLqO9WZaOwejQ==","signatures":[{"sig":"MEQCICRBHWn9zWhshQM7LtoznIN4SzYEhR/HeXUMNgNxIGmmAiB4UoFzqYzgDAdZnUOUQolznspXba8UELQHinvHC0/lyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57684},"main":"build/index.js","types":"build/index.d.ts","gitHead":"d1fcff6601bdef942d4ac5908c0afed3700aeb3f","scripts":{"test":"expo-module test","build":"expo-module build","clean":"expo-module clean","prepare":"expo-module prepare","pack:check":"npm pack --dry-run","prepublishOnly":"EXPO_NONINTERACTIVE=1 expo-module build"},"_npmUser":{"name":"blacktomang","email":"blacktomang@gmail.com"},"_npmVersion":"10.9.7","description":"Expo native module wrapping AWS Amplify Face Liveness UI for iOS and Android","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@expo/config-plugins":"^54.0.0"},"_hasShrinkwrap":false,"devDependencies":{"expo":"~54.0.34","react":"19.1.0","typescript":"~5.9.2","@types/react":"~19.1.10","react-native":"0.81.5","expo-module-scripts":"^4.1.10"},"peerDependencies":{"expo":">=54.0.0","react":">=19.0.0","react-native":">=0.81.0"},"_npmOperationalInternal":{"tmp":"tmp/expo-aws-liveness_0.1.0_1784985958673_0.32675718511499086","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@blacktomang/expo-aws-liveness","version":"0.2.2","description":"Expo native module wrapping AWS Amplify Face Liveness UI for iOS and Android","main":"build/index.js","types":"build/index.d.ts","scripts":{"build":"expo-module build","clean":"expo-module clean","test":"expo-module test","prepare":"expo-module prepare && husky","prepublishOnly":"EXPO_NONINTERACTIVE=1 expo-module build","pack:check":"npm pack --dry-run"},"keywords":["react-native","expo","aws","amplify","liveness","rekognition"],"author":{"name":"Syam"},"license":"MIT","homepage":"https://github.com/blacktomang/expo-aws-liveness#readme","repository":{"type":"git","url":"git+https://github.com/blacktomang/expo-aws-liveness.git"},"bugs":{"url":"https://github.com/blacktomang/expo-aws-liveness/issues"},"publishConfig":{"access":"public"},"peerDependencies":{"expo":">=54.0.0","react":">=19.0.0","react-native":">=0.81.0"},"dependencies":{"@expo/config-plugins":"^54.0.0"},"devDependencies":{"@commitlint/cli":"^21.2.1","@commitlint/config-conventional":"^21.2.0","@types/jest":"^29.5.14","@types/react":"~19.1.10","babel-jest":"^29.7.0","expo":"~54.0.34","expo-module-scripts":"^4.1.10","husky":"^9.1.7","jest":"^29.7.0","react":"19.1.0","react-native":"0.81.5","react-test-renderer":"19.0.0","typescript":"~5.9.2"},"gitHead":"4ddf82e1276eb424750a851d8930b652b7540f80","_id":"@blacktomang/expo-aws-liveness@0.2.2","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-nOqqbAWbAbqbcvuovQKSc2sIyeYTSl7vUwK5j1mJxTpmiiBr7BlsWpMCVtI3K30JAYXaLYhzC8/ihgQ0mYA5pw==","shasum":"78bd644928baa5e7cfba817aa588254848316459","tarball":"https://registry.npmjs.org/@blacktomang/expo-aws-liveness/-/expo-aws-liveness-0.2.2.tgz","fileCount":47,"unpackedSize":99291,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@blacktomang%2fexpo-aws-liveness@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCeADRsObhf72qptRPb+co69xrUANuFhdURv7RoKQIUOwIhALvLqUXkS9W5obnZesM2kbWdE00J6qNhcXgjHzMk3ay1"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7d0e1336-0cf3-4c44-91a8-dc2f010ecd0c"}},"directories":{},"maintainers":[{"name":"blacktomang","email":"blacktomang@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/expo-aws-liveness_0.2.2_1785012920766_0.7178519408571988"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-25T13:25:58.485Z","modified":"2026-07-25T20:55:21.174Z","0.1.0":"2026-07-25T13:25:58.874Z","0.2.2":"2026-07-25T20:55:20.907Z"},"author":{"name":"Syam"},"license":"MIT","keywords":["react-native","expo","aws","amplify","liveness","rekognition"],"description":"Expo native module wrapping AWS Amplify Face Liveness UI for iOS and Android","maintainers":[{"name":"blacktomang","email":"blacktomang@gmail.com"}],"readme":"# @blacktomang/expo-aws-liveness\n\nAn Expo native module for Amazon Rekognition Face Liveness. It bridges AWS's\nofficial Android Compose and iOS SwiftUI liveness components to an Expo app.\n\nThis package requires a native build. It does **not** run in Expo Go.\n\n## Install\n\n```sh\npnpm add @blacktomang/expo-aws-liveness\n```\n\nAdd the plugin to your Expo configuration. It adds Android camera permission\nand, unless you already set one, an iOS camera-usage description.\n\n```ts\n// app.config.ts\nexport default {\n  expo: {\n    plugins: [\n      [\n        \"@blacktomang/expo-aws-liveness\",\n        {\n          cameraPermission:\n            \"Allow $(PRODUCT_NAME) to use the camera for face verification.\",\n        },\n      ],\n    ],\n  },\n};\n```\n\nRebuild native projects after adding or upgrading the package:\n\n```sh\nnpx expo prebuild --clean\nnpx expo run:android\n# or: npx expo run:ios\n```\n\n## iOS first build: please be patient\n\nThe first iOS build can take noticeably longer than Android. This package uses\nAWS's native SwiftUI liveness component, which Xcode downloads through Swift\nPackage Manager along with its AWS dependencies.\n\nOn a new machine, a clean cache, or a fresh CI runner, Xcode may spend several\nminutes at **Resolving Package Graph** or **Planning build**. It can look like\nthe build has stopped, but it is usually downloading and preparing those Swift\npackages. Once they are cached, later iOS builds are much faster.\n\nIf you want to see package-resolution progress directly, run this from your\ngenerated iOS directory (replace `<AppName>` with your app's iOS project name):\n\n```sh\ncd ios\nxcodebuild -workspace <AppName>.xcworkspace \\\n  -scheme <AppName> \\\n  -resolvePackageDependencies\n```\n\nFor CI, cache the Xcode/Swift Package Manager dependency cache when possible.\nThe module pins its native AWS dependency versions so the resolved build stays\nreproducible.\n\n## Usage\n\n```tsx\nimport { useRef } from \"react\";\nimport { Button } from \"react-native\";\nimport {\n  ExpoAwsLiveness,\n  type ExpoAwsLivenessHandle,\n} from \"@blacktomang/expo-aws-liveness\";\n\nfunction VerifyFace() {\n  const liveness = useRef<ExpoAwsLivenessHandle>(null);\n\n  const startLiveness = async () => {\n    if (!liveness.current) return;\n\n    try {\n      await liveness.current.start();\n      await getLivenessResult(sessionId);\n    } catch (error) {\n      // onError receives the same normalized failure.\n    }\n  };\n\n  return (\n    <>\n      <ExpoAwsLiveness\n        ref={liveness}\n        sessionId={sessionId}\n        region=\"us-east-1\"\n        identityPoolId=\"us-east-1:your-identity-pool-id\"\n        onError={(error) =>\n          console.error(error.code, error.nativeErrorCode, error.message)\n        }\n        style={{ flex: 1 }}\n      />\n      <Button title=\"Verify face\" onPress={startLiveness} />\n    </>\n  );\n}\n```\n\n`start()` returns `{ isLive: true }` on completion and invokes `onComplete` / `onError` with the same outcome. An overlapping call rejects with `LIVENESS_IN_PROGRESS`. Errors use a stable `code` and retain the iOS or Android SDK value in `nativeErrorCode`.\n\nAndroid displays the detector inside `ExpoAwsLiveness`, so `style` controls its layout. iOS presents the detector full-screen and ignores `style`.\n\n## Why iOS and Android differ internally\n\nAndroid can embed AWS Face Liveness directly: the AWS SDK exposes a Jetpack Compose component, which this module mounts inside a React Native native view.\n\niOS uses the same public `ExpoAwsLiveness` API, but presents the detector modally. AWS Face Liveness and its Amplify dependencies are Swift Package Manager packages, while Expo modules compile as CocoaPods. Importing those Swift packages from the Expo pod fails native AWS C-module resolution. To work around that limitation, the config plugin adds the Swift packages and a small liveness implementation to the host app target, where SwiftPM dependencies link correctly.\n\nThis means that on iOS the detector:\n\n- Is always presented full-screen from the active view controller; it cannot be embedded or styled as a React Native view.\n- Requires the config plugin's generated AppDelegate registration and host-app Swift source.\n- Returns its result after the modal screen finishes, while Android receives native view events. `ExpoAwsLiveness` normalizes both approaches behind `start()`, `onComplete`, and `onError`.\n\nOn both platforms, Amplify can only be configured once per app process. Reusing the module with a different region or identity pool returns `AMPLIFY_CONFIG_CONFLICT`.\n\n## Legacy APIs\n\n`ExpoAwsLivenessView` (Android-only) and `presentLiveness` (iOS-only) remain available for existing applications, but are deprecated. Migrate to `ExpoAwsLiveness` to remove platform branches from application code.\n\n```tsx\n// Deprecated Android-only API\n<ExpoAwsLivenessView\n  sessionId={sessionId}\n  region=\"us-east-1\"\n  identityPoolId=\"us-east-1:your-identity-pool-id\"\n  onComplete={() => getLivenessResult(sessionId)}\n  onError={(error) => console.error(error.errorCode, error.message)}\n  style={{ flex: 1 }}\n/>\n```\n\nCreate the liveness session and retrieve its score on your backend. The client\nshould receive a one-time `sessionId` and temporary Cognito permissions only\nfor `rekognition:StartFaceLivenessSession`.\n","readmeFilename":"README.md","homepage":"https://github.com/blacktomang/expo-aws-liveness#readme","repository":{"type":"git","url":"git+https://github.com/blacktomang/expo-aws-liveness.git"},"bugs":{"url":"https://github.com/blacktomang/expo-aws-liveness/issues"}}