mount
function(): void

Responsible for mounting the SDK and should be called after the configuration.

Example:

<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/faceindex.js"></script>
<script type="text/javascript">
  const sdkInstance = LegitimuzFaceIndex({
    /* ...options */
  });

  // Mount SDK
  sdkInstance.mount();
</script>
setLang
function(lang: 'pt' | 'en' | 'es'): void

Responsible for changing the language of the Face Index flow.

Example:

<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/faceindex.js"></script>
<script type="text/javascript">
  const sdkInstance = LegitimuzFaceIndex({
    /* ...options */
  });

  // Mount SDK
  sdkInstance.mount();

  // Change language
  sdkInstance.setLang('en');
</script>
closeModal
function(): void

Responsible for closing the Face Index modal.

Example:

<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/faceindex.js"></script>
<script type="text/javascript">
  const sdkInstance = LegitimuzFaceIndex({
    /* ...options */
  });

  // Mount SDK
  sdkInstance.mount();

  // Close verification modal
  sdkInstance.closeModal();
</script>
changeFieldId
function(params: object): void

Change the id of the field used to extract the CPF.

Example:

<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/faceindex.js"></script>
<script type="text/javascript">
  const sdkInstance = LegitimuzFaceIndex({
    /* ...options */
  });

  // Mount SDK
  sdkInstance.mount();

  // Change CPF field id
  sdkInstance.changeFieldId({
    fieldName: "cpf",
    fieldId: "my-custom-id",
  });
</script>
startFaceIndex
function(params: object): void

Start the Face Index flow via JavaScript.

Example:

<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/faceindex.js"></script>
<script type="text/javascript">
  const sdkInstance = LegitimuzFaceIndex({
    /* ...options */
  });

  // Mount SDK
  sdkInstance.mount();

  sdkInstance.startFaceIndex({ cpf: "12345678901" });
</script>