---
title: Capture API
canonical: https://developer.unico.io/dual-api/developers/sdks-and-tools/web/web-sdk/api-reference/capture-api
locale: en
generated_by: markdown-export
---

- [/](/)
- [SDKs and Tools](/dual-api/developers/sdks-and-tools/overview)
- [Web Integration](/dual-api/developers/sdks-and-tools/web/)
- [Web SDK](/dual-api/developers/sdks-and-tools/web/web-sdk/requirements)
- API Reference
- Capture API

# Capture API

Methods to start a session
| Method | Description |
| --- | --- |
| `prepareSelfieCamera(config, cameraType)` | Prepares the selfie camera. Returns a `Promise<CameraOpener>`. |
| `prepareSelfieCameraForIFrame(config, cameraType)` | Prepares the selfie camera for use inside an iFrame. Returns a `Promise<CameraOpener>`. |
| `prepareDocumentCamera(config, documentType)` | Prepares the document camera. Returns a `Promise<CameraOpener>`. |
| `cameraOpener.open(callback)` | Opens the prepared camera with the `callback` object |

Capture options / parameters
**`SelfieCameraTypes`** — see [Enums](/dual-api/developers/sdks-and-tools/web/web-sdk/api-reference/enums).

**`DocumentCameraTypes`** — see [Enums](/dual-api/developers/sdks-and-tools/web/web-sdk/api-reference/enums).

Result types and fields
The success handler receives an object with:

| Field | Type | Description |
| --- | --- | --- |
| `base64` | `String` | Captured image in Base64 |
| `encrypted` | `String` | JWT to be sent to the backend |

Last updated on **Oct 8, 2026**