host
string
required
The host is the address of the Legitimuz API.Example: https://api.legitimuz.com
token
string
required
The token is your integration token. You can generate an integration token on the integrations page under the installation tab in the Legitimuz Dashboard.
lang
string: pt | en | es
default:"pt"
The lang option sets the language that will be used in the OCR + Facematch validation flow.
enableRedirect
boolean
default:"false"
The enableRedirect option is a boolean that defines whether, after the OCR + Facematch validation flow, the user will be redirected to the link registered in the Legitimuz Dashboard.
autoOpenValidation
boolean
default:"false"
The autoOpenValidation option is a boolean that defines whether the popup for OCR + Facematch validation will automatically open after entering a value in the cpf input.
balanceValue
number | string
default:"undefined"
A opção balanceValue é o valor do saldo do usuário.
<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"></script>
<script type="text/javascript">
  const sdkInstance = Legitimuz({
    /* opções */
    balanceValue: 123,
  });
  sdkInstance.mount();
</script>
withdrawValue
number | string
default:"undefined"
A opção withdrawValue é o valor do saque do usuário.
<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"></script>
<script type="text/javascript">
  const sdkInstance = Legitimuz({
    /* opções */
    withdrawValue: 123,
  });
  sdkInstance.mount();
</script>
onSuccess
function: (eventName: 'ocr' | 'facematch'): void
The success callback is triggered when success occurs at any stage of the OCR + Facematch validation flow. A string with the stage where success occurred is passed as a parameter.Examples:
<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"></script>
<script type="text/javascript">
  const sdkInstance = Legitimuz({
    /* options */
    onSuccess(eventName) {
      console.log(eventName); // ocr | facematch
    },
  });

  sdkInstance.mount();
</script>
onError
function: (eventName: 'ocr' | 'facematch'): void
The error callback is triggered when an error occurs at any stage of the OCR + Facematch validation flow. A string with the stage where the error occurred is passed as a parameter.Examples:
<div id="legitimuz-root"></div>
<script src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"></script>
<script type="text/javascript">
  const sdkInstance = Legitimuz({
    /* options */
    onError(eventName) {
      console.log(eventName); // ocr | facematch
    },
  });

  sdkInstance.mount();
</script>