# `@tsocial/tvweb-sdk.msb`

## Install

```html
<script src="https://cdn.jsdelivr.net/npm/@tsocial/tvweb-sdk.msb@latest/build/tvweb-sdk.msb.standalone.min.js" />
```

## Usage

```javascript
const tv = new TVWebSDK.SDK({
  container: document.getElementById("container"),
  lang: "vi",
  assetRoot: "https://cdn.jsdelivr.net/npm/@tsocial/tvweb-sdk.msb@latest/assets",
});

// Main functions:
tv.readIDCard({
  apiCheck: false,
  cardSide: TVWebSDK.Constants.IDCardSide.FRONT,
  frontCamera: false,
  frontCardId: "", // in case read id card back side
  title: "Mặt trước CMND/CCCD",
  description: "Căn mặt trước CMND/CCCD vào khung",
  onSuccess: handleReadIDCardResult,
});

tv.livenessDetection({
  mode: TVWebSDK.Constants.Mode.ACTIVE,
  apiCheck: false,
  onLivenessDetectionDone: handleLivenessDetectionDone,
  onError: (e) => alert(e.code),
});

tv.compareFaces({
  accessKey: inputAccessKey.value,
  secretKey: inputSecretKey.value,
  apiUrl: inputApiUrl.value,
  image1: '',
  image2: '',
  onSuccess: (rs) => console.log(rs),
  onError: (e) => console.log(e)
})

tv.checkCamera({ frontCamera: true }).then((error) => console.log(error));
```
## More details:
https://docs.google.com/document/d/1v7loVZJ8vVS4cLZYKi-PxhiwH1Ns5Uy4un1GpRfWxro/