> ## Documentation Index
> Fetch the complete documentation index at: https://legitimuz.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Options

> See how to further customize the SDK

<ResponseField name="host" type="string" required>
  The host is the address of the Legitimuz API.

  Example: `https://api.legitimuz.com`
</ResponseField>

<ResponseField name="token" type="string" required>
  The token is your integration token. You can generate an integration token on the
  [integrations](https://dashboard.legitimuz.com/dashboard/integrations) page under the `installation` tab in the Legitimuz Dashboard.
</ResponseField>

<ResponseField name="lang" type="string: pt | en | es" default="pt">
  The `lang` option sets the language that will be used in the [OCR + Facematch validation](/sdk-reference/legitimuz/ocr-facematch) flow.
</ResponseField>

<ResponseField name="enableRedirect" type="boolean" default="false">
  The `enableRedirect` option is a boolean that defines whether, after the [OCR + Facematch validation](/sdk-reference/legitimuz/ocr-facematch) flow, the user will be redirected to the link registered in the Legitimuz Dashboard.
</ResponseField>

<ResponseField name="autoOpenValidation" type="boolean" default="false">
  The `autoOpenValidation` option is a boolean that defines whether the `popup` for [OCR + Facematch validation](/sdk-reference/legitimuz/ocr-facematch) will automatically open after entering a value in the [cpf input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input).
</ResponseField>

<ResponseField name="balanceValue" type="number | string" default="undefined">
  A opção balanceValue é o valor do saldo do usuário.

  <CodeGroup>
    ```html HTML theme={null}
    <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>
    ```

    ```jsx JSX theme={null}
    import { useRef } from 'react';

    function Component() {
      const sdkInstance = useRef(null);

      const handleOnLoadSDK = () => {
        sdkInstance.current = Legitimuz({
          /* options */
          balanceValue: 123,
        });

        sdkInstance.current.mount();
      }

      return (
        <>
          <input id="legitimuz-hydrate-cpf" type="tel" />
          <script
            src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"
            onLoad={handleOnLoadSDK}
          ></script>
        </>
      );
    }
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="withdrawValue" type="number | string" default="undefined">
  A opção withdrawValue é o valor do saque do usuário.

  <CodeGroup>
    ```html HTML theme={null}
    <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>
    ```

    ```jsx JSX theme={null}
    import { useRef } from 'react';

    function Component() {
      const sdkInstance = useRef(null);

      const handleOnLoadSDK = () => {
        sdkInstance.current = Legitimuz({
          /* options */
          withdrawValue: 123,
        });

        sdkInstance.current.mount();
      }

      return (
        <>
          <input id="legitimuz-hydrate-cpf" type="tel" />
          <script
            src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"
            onLoad={handleOnLoadSDK}
          ></script>
        </>
      );
    }
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="onSuccess" type="function: (eventName: 'ocr' | 'facematch'): void">
  The success callback is triggered when `success` occurs at any stage of the [OCR + Facematch validation](/sdk-reference/legitimuz/ocr-facematch) flow. A [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) with the stage where success occurred is passed as a parameter.

  Examples:

  <CodeGroup>
    ```html theme={null}
    <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>
    ```

    ```jsx theme={null}
    import { useRef } from 'react';

    function Component() {
      const sdkInstance = useRef(null);

      const handleOnLoadSDK = () => {
        sdkInstance.current = Legitimuz({
          /* options */
          onSuccess(eventName) {
            console.log(eventName); // ocr | facematch
          },
        });

        sdkInstance.current.mount();
      }

      return (
        <>
          <input id="legitimuz-hydrate-cpf" type="tel" />
          <script
            src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"
            onLoad={handleOnLoadSDK}
          ></script>
        </>
      );
    }
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="onError" type="function: (eventName: 'ocr' | 'facematch'): void">
  The error callback is triggered when an `error` occurs at any stage of the [OCR + Facematch validation](/sdk-reference/legitimuz/ocr-facematch) flow. A [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) with the stage where the error occurred is passed as a parameter.

  Examples:

  <CodeGroup>
    ```html theme={null}
    <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>
    ```

    ```jsx theme={null}
    import { useRef } from 'react';

    function Component() {
      const sdkInstance = useRef(null);

      const handleOnLoadSDK = () => {
        sdkInstance.current = Legitimuz({
          /* options */
          onError(eventName) {
            console.log(eventName); // ocr | facematch
          },
        });

        sdkInstance.current.mount();
      }

      return (
        <>
          <input id="legitimuz-hydrate-cpf" type="tel" />
          <script
            src="https://cdn.legitimuz.com/js/sdk/legitimuz-sdk.js"
            onLoad={handleOnLoadSDK}
          ></script>
        </>
      );
    }
    ```
  </CodeGroup>
</ResponseField>
