Skip to content

feat(docs): Add no light details to the liveness component docs #6593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/data/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ export const FRAMEWORK_INSTALL_SCRIPTS = {
vue: 'npm i @aws-amplify/ui-vue aws-amplify',
angular: 'npm i @aws-amplify/ui-angular aws-amplify',
flutter: 'flutter pub add amplify_authenticator',
android: "implementation 'com.amplifyframework.ui:liveness:1.3.0'",
android: "implementation 'com.amplifyframework.ui:liveness:1.5.0'",
'react-native': `npm i @aws-amplify/ui-react-native aws-amplify ${REACT_NATIVE_DEPENDENCIES}`,
};
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import AmplifyCLI from './amplify-cli.mdx';
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.2.0'
kotlinCompilerExtensionVersion '1.5.3'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const FACE_LIVENESS_DETECTOR_PARAMETERS = [
},
{
name: `credentialsProvider`,
description: 'An optional paramter that provides AWS Credentials',
description: 'An optional parameter that provides AWS Credentials.',
type: `AWSCredentialsProvider?`,
},
{
Expand All @@ -21,6 +21,12 @@ export const FACE_LIVENESS_DETECTOR_PARAMETERS = [
'Optional parameter for the disabling the intial view with instructions, default = false.',
type: `Boolean`,
},
{
name: `challengeOptions`,
description:
'Optional parameter that allows you to configure options for a given liveness challenge.',
type: `ChallengeOptions`,
},
{
name: `onComplete`,
description:
Expand Down Expand Up @@ -62,6 +68,12 @@ export const FACE_LIVENESS_DETECTOR_ERROR_STATES = [
'The session timed out and did not receive response from server within the time limit.',
type: `Error`,
},
{
name: `FaceLivenessDetectionException.UnsupportedChallengeTypeException`,
description:
'The backend sent a liveness challenge that is not supported by the library.',
type: `Error`,
},
{
name: `FaceLivenessDetectionException.UserCancelledException`,
description: 'The user cancelled the face liveness check.',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Alert } from '@aws-amplify/ui-react';

## Challenge Options

Certain liveness challenges have client-side options that you can configure based on your business requirements. For example, you can configure the `FaceMovement` challenge to use either the device's front-facing camera or back-facing camera.

```kotlin
FaceLivenessDetector(
sessionId = <session ID>,
region = <region>,
challengeOptions = ChallengeOptions(
faceMovement = LivenessChallenge.FaceMovement(camera = Camera.Back)
),
onComplete = {
Log.i("MyApp", "Face Liveness flow is complete")
},
onError = { error ->
Log.e("MyApp", "Error during Face Liveness flow", error)
}
)
```

<Alert variation="info" role="none">
When the FaceLivenessDetector is rendered, Rekognition will mark the session ID as used and any future usages of the FaceLivenessDector will require a new session ID. So if you want to change which camera is used for the FaceMovement challenge at runtime, you will need to create a new liveness session and pass the new session ID into the FaceLivenessDetector with the new Camera option.
</Alert>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Alert } from '@aws-amplify/ui-react';

## Challenge Options

Certain liveness challenges have client-side options that you can configure based on your business requirements. For example, you can configure the `FaceMovement` challenge to use either the device's front-facing camera or back-facing camera.

```swift
FaceLivenessDetectorView(
sessionID: <session ID>,
region: <region>,
challengeOptions: .init(faceMovementChallengeOption: .init(camera: .back)),
isPresented: $isPresentingLiveness,
onCompletion: { result in
switch result {
case .success:
// ...
case .failure(let error):
// ...
default:
// ...
}
}
)
```

<Alert variation="info" role="none">
When the FaceLivenessDetector is rendered, Rekognition will mark the session ID as used and any future usages of the FaceLivenessDector will require a new session ID. So if you want to change which camera is used for the FaceMovement challenge at runtime, you will need to create a new liveness session and pass the new session ID into the FaceLivenessDetector with the new Camera option.
</Alert>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { getCustomStaticPath } from '@/utils/getCustomStaticPath';
import StartAndroid from './customization.start-view.android.mdx';
import StartReact from './customization.start-view.react.mdx';
import StartSwift from './customization.start-view.swift.mdx';
import OptionsAndroid from './customization.options.android.mdx';
import OptionsSwift from './customization.options.swift.mdx';
import I18Android from './customization.i18n.android.mdx';
import I18React from './customization.i18n.react.mdx';
import I18Swift from './customization.i18n.swift.mdx';
Expand Down Expand Up @@ -43,6 +45,14 @@ export async function getStaticProps() {
<StartSwift />
</InlineFilter>

<InlineFilter filters={['android']}>
<OptionsAndroid />
</InlineFilter>

<InlineFilter filters={['swift']}>
<OptionsSwift />
</InlineFilter>

## Internationalization (I18n)

<InlineFilter filters={['android']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FACE_LIVENESS_DETECTOR_PARAMETERS, FACE_LIVENESS_DETECTOR_ERROR_STATES

## Full API Reference

### FaceLivenessDetectorView Parameters
### FaceLivenessDetector Parameters

Below is the full list of parameters that can be used with the `FaceLivenessDetector` component. You can also reference the [source code here](https://github.com/aws-amplify/amplify-ui-android/blob/main/liveness/src/main/java/com/amplifyframework/ui/liveness/ui/FaceLivenessDetector.kt#L73).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.2.0'
kotlinCompilerExtensionVersion '1.5.3'
}
```

Expand All @@ -28,10 +28,10 @@ Add the following dependencies to your **app**'s `build.gradle` file and click "
```groovy
dependencies {
// FaceLivenessDetector dependency
implementation 'com.amplifyframework.ui:liveness:1.3.0'
implementation 'com.amplifyframework.ui:liveness:1.5.0'
// Amplify Auth dependency (unnecessary if using your own credentials provider)
implementation 'com.amplifyframework:aws-auth-cognito:2.26.0'
implementation 'com.amplifyframework:aws-auth-cognito:2.29.0'
// Material3 dependency for theming FaceLivenessDetector
implementation 'androidx.compose.material3:material3:1.1.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ FaceLivenessDetector(
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.2.0'
kotlinCompilerExtensionVersion '1.5.3'
}
```

Expand All @@ -156,7 +156,7 @@ FaceLivenessDetector(
```groovy
dependencies {
// FaceLivenessDetector dependency
implementation 'com.amplifyframework.ui:liveness:1.3.0'
implementation 'com.amplifyframework.ui:liveness:1.5.0'
// Material3 dependency for theming FaceLivenessDetector
implementation 'androidx.compose.material3:material3:1.1.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const FACE_LIVENESS_DETECTOR_PARAMETERS = [
},
{
name: `credentialsProvider`,
description: 'An optional paramter that provides AWS Credentials',
description: 'An optional parameter that provides AWS Credentials',
type: `AWSCredentialsProvider`,
},
{
Expand All @@ -21,6 +21,12 @@ export const FACE_LIVENESS_DETECTOR_PARAMETERS = [
'Optional parameter for the disabling the intial view with instructions, default: false.',
type: `Bool`,
},
{
name: `challengeOptions`,
description:
'Optional parameter that allows you to configure options for a given liveness challenge.',
type: `ChallengeOptions`,
},
{
name: `isPresented`,
description:
Expand Down Expand Up @@ -68,6 +74,11 @@ export const FACE_LIVENESS_DETECTOR_ERROR_STATES = [
description: 'The camera permission has not been granted.',
type: `Error`,
},
{
name: `.cameraNotAvailable`,
description: 'The camera is not available due to a hardware issue.',
type: `Error`,
},
{
name: `.userCancelled`,
description: 'The user cancelled the face liveness check.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ReactNativeSafeAreaContextInstallation } from '@/components/ReactNative
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.2.0'
kotlinCompilerExtensionVersion '1.5.3'
}
}
Expand Down
Loading