Skip to main content

Presets

Presets bundle defaults for quality thresholds, capture behavior (auto-capture, cooldowns), output settings, UI strings, and flow steps (permission → guidance → capture → confirm).

At runtime, configuration merges as:

global defaults → built-in preset → your JSON / attributes

Built-in presets​

PresetPurpose
faceStandard front-facing selfie capture. Default if you omit preset.
handStandard hand capture

Set the preset via attribute or config:

<glamar-captureiq api-key="YOUR_KEY" preset="face"></glamar-captureiq>
{ "preset": "hand" }

What a preset controls (conceptually)​

Each built-in preset supplies defaults for:

  • quality — minimum brightness, face presence, alignment, etc.
  • capture — autoCapture, holdSteadyMs, cooldownMs, maxAttempts
  • output — image format, MIME type, max dimensions, encoding quality
  • ui — instructions, errors, button labels
  • flow — ordered steps for permission, guidance, capture, and confirm

You can override any of these fields through the config JSON—see Configuration.

Validation​

If your JSON breaks validation rules (for example quality numbers outside 0–1, or flow.steps missing required steps), the element emits configError. Invalid JSON syntax emits a regular error with code config-parse-error. See Events and Troubleshooting.

Tuning quality​

The preset sets starting thresholds; for difficult lighting or devices, adjust quality and capture in JSON rather than changing code. If auto-capture never fires, thresholds may be too strict—see Troubleshooting.