> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphi-biometria-facial/propiedades/cameratype.md).

# cameraType

## Details

**Attribute:** `camera-type`

**Type:** `CameraType`

**Default value:** `CameraType.User`

### CameraType

| Member        | Value | Description                |
| ------------- | ----- | -------------------------- |
| `User`        | `0`   | Front camera.              |
| `Environment` | `1`   | Rear camera, if available. |

## Morphology

```typescript
import { CameraType } from '@facephi/selphi-web-component';

selphi.cameraType = CameraType.User;
```

## Description

Select whether `facephi-selphi-widget` to use the front camera (`CameraType.User`) or the rear camera (`CameraType.Environment`) when the device allows it.

### Additional information

**Recommended property:** use `cameraPreferred` in new integrations. Unlike `cameraType`, `cameraPreferred` **do not** uses the enum `CameraType`, but its own text enum `CameraPreferred`:

| Member  | Value     | Equivalent to            |
| ------- | --------- | ------------------------ |
| `Front` | `'FRONT'` | `CameraType.User`        |
| `Back`  | `'BACK'`  | `CameraType.Environment` |

**Precedence:** if you define `cameraType` and `cameraPreferred` at the same time, `cameraPreferred` takes precedence and a precedence warning is emitted in the console.

**Deprecation:** `cameraType` is still operational in this version, but it will be removed in the next major version. Use only `cameraType` emits a deprecation warning in the console.

***

## Example

```jsx
import { CameraType } from '@facephi/selphi-web-component';

<facephi-selphi-widget
    cameraType={CameraType.User}
/>
```
