Skip to Content
Device CapabilitiesopenFaceCamera

openFaceCamera

Use openFaceCamera when you need real-time face detection — such as selfies, profile photos etc — instead of plain camera access.

It adds face detection, alignment guidance (framing overlay), status messages, and optional auto-capture when the face meets quality criteria.

When to use this instead of openCamera

  • You want visual guidance to center and align the face before capture
  • You need automatic capture once a valid face is detected
  • You want stricter face quality rules (especially on web with accuracyConfig)

Key Properties

PropertyTypeDescription
idstringBind captured result (access via ${yourId.files})
onCaptureactionRuns after successful capture (event.data.files available)
onErroractionHandles errors (event.error available)
optionsobjectControls camera lens, UI, auto-capture, resolution, flash, and detection

Quick Examples

Basic face capture

- Button: label: Open Face Camera onTap: openFaceCamera: id: myFace

Auto-capture verified selfie

- Button: label: Capture Verified Selfie onTap: openFaceCamera: id: profilePhoto options: initialCamera: front autoCapture: true message: "Align your face in the frame" performanceMode: accurate onCapture: showToast: message: "Selfie captured!" onError: showToast: message: "Capture failed: ${event.error}"

To learn more about openCamera functionalities, test it out here in Ensemble Kitchen Sink  app.

Last updated on