> 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/sdk-provider/metodos/checkcapabilities.md).

# checkCapabilities

Checks whether the device meets the Minimum requirements before mounting the SDK.

## Details

Check whether the browser and device meet the Minimum requirements to run the Biometric flow, **before** mounting `<facephi-sdk-provider>` in the DOM.

### Syntax

```typescript
import { checkCapabilities } from '@facephi/sdk-web-wc/capabilities.mjs';

const { camera, wasm, browser } = await checkCapabilities();
```

## Description

Function exported by `@facephi/sdk-web-wc` in the subpath `/capabilities.mjs`. It allows you to decide, before starting the session, whether the user can continue on this device or whether it is better to route them to another device or another business path.

Does not require `apiKey`, does not validate the License and does not download resources. The entry point has no dependencies, so it does not pull in the engine, languages, or UI components.

Replaces the method `checkCapabilities()` of the Legacy widgets.

### Return value

`Promise<WidgetCheckCapabilities>`, with three booleans:

| Property  | Meaning                                                            |
| --------- | ------------------------------------------------------------------ |
| `camera`  | At least one video input device has been detected.                 |
| `wasm`    | WebAssembly is available and can compile and instantiate a module. |
| `browser` | The browser APIs required by the widgets are present.              |

### Considerations

{% hint style="warning" %}
`camera` is a **signal, not a guarantee**. Treat it as a soft condition: always offer an alternative path **and** and a retry, never a dead end.
{% endhint %}

* The check **does not call `getUserMedia`**, so it does not show any camera permission dialog. It can be invoked when the page loads with no friction for the user.
* As a trade-off, browsers that hide devices until permission is granted (Safari and others based on WebKit) return `camera: false` on a perfectly valid device.
* In an insecure origin (`http` other than `localhost`), `navigator.mediaDevices` does not exist and `camera` will always be `false`.
* The check does not apply the camera anti-fraud filter that the widgets do when they mount. A virtual camera passes this check and is still rejected later.

`wasm` and `browser` are hard conditions: if any of them is `false`, the Biometric flow cannot run in that browser.

***

## Example

```jsx
import { checkCapabilities } from '@facephi/sdk-web-wc/capabilities.mjs';

const { camera, wasm, browser } = await checkCapabilities();

if (!wasm || !browser) {
  // Hard condition: this browser cannot run the flow.
  return redirigirA('/navegador-no-compatible');
}

if (!camera) {
  // Soft condition: offer to continue on another device, allowing a retry.
  return redirigirA('/continuar-en-otro-dispositivo');
}

<facephi-sdk-provider apikey={process.env.FACEPHI_SDK_APIKEY} />
```

### Use from CDN, without bundler

```html
<script type="module">
  import { checkCapabilities } from 'https://cdn.facephi.pro/@facephi/sdk-web-wc@latest/bundle/capabilities.js';

  const { camera, wasm, browser } = await checkCapabilities();
</script>
```

### Direct use of the Widget, without SDK

The Widget packages expose the same function in their own subpath, available from `@facephi/selphi-web-component@6.40.0` and `@facephi/selphid-web-component@6.39.0`. In earlier versions the subpath does not exist and the import fails with `ERR_MODULE_NOT_FOUND`.

```typescript
// Selphi
import { checkCapabilities } from '@facephi/selphi-web-component/capabilities.mjs';

// SelphID
import { checkCapabilities } from '@facephi/selphid-web-component/capabilities.mjs';
```
