> ## 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.

# Methods

> See how to customize the SDK even more

<ResponseField name="mount" type="function(): void">
  It is responsible for mounting the SDK and should be called after configuration.

  Example:

  <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({
        /* ...Options */
      });

      // Mount SDK
      sdkInstance.mount();
    </script>
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="verifyDocument" type="function({ cpf: '99999999999' }): void">
  Responsible for starting the verification process programmatically wherever you want in your code.

  <Expandable title="params">
    <ResponseField name="cpf" type="string" required>
      CPF to be verified
      Example: `99999999999`
    </ResponseField>

    <ResponseField name="phone" type="string">
      Phone number
      Example: `99999999999`
    </ResponseField>

    <ResponseField name="referenceId" type="string">
      Reference ID, any string that you want to use to identify the verification
      Example: `my-reference-id`
    </ResponseField>
  </Expandable>

  Example:

  <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({
        /* ...options */
      });

      // need to mount the SDK before you can call verifyDocument
      sdkInstance.mount();

      // Function to start the verification flow programmatically
      sdkInstance.verifyDocument({ cpf: "99999999999" });
    </script>
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="setLang" type="function(lang: 'pt' | 'en' | 'es'): void">
  It is responsible for changing the language of the [OCR + Facematch validation](/sdk-reference/legitimuz/ocr-facematch) flow.

  Example:

  <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({
        /* ...options */
      });

      // Mount SDK
      sdkInstance.mount();

      // Change language
      sdkInstance.setLang('en');
    </script>
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="changeFieldId" type="function(params: object): void">
  It is responsible for changing the [id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)
  of the [enriched](/sdk-reference/legitimuz/enrichment) fields.

  <Expandable title="params">
    <ResponseField name="fieldName" type="string" required>
      Field name

      [Click here](/sdk-reference/legitimuz/fields) to see the available fields.
    </ResponseField>

    <ResponseField name="fieldId" type="string" required>
      New field id

      Example: `my-custom-id`
    </ResponseField>
  </Expandable>

  Example:

  <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({
        /* ...options */
      });

      // Mount SDK
      sdkInstance.mount();

      // Change field id for cpf
      sdkInstance.changeFieldId({
        fieldName: "cpf",
        fieldId: "my-custom-id",
      });
    </script>
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="changeActionId" type="function(params: object): void">
  It is responsible for changing the [id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)
  of the elements that trigger the [actions](/sdk-reference/legitimuz/actions).

  <Expandable title="params">
    <ResponseField name="actionName" type="string" required>
      Action name

      [Click here](/sdk-reference/legitimuz/fields) to see the available fields.
    </ResponseField>

    <ResponseField name="actionId" type="string" required>
      New id of the element that triggers the action

      Example: `my-custom-id`
    </ResponseField>
  </Expandable>

  Example:

  <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({
        /* ...options */
      });

      // Mount SDK
      sdkInstance.mount();

      // Change action id for verify
      sdkInstance.changeActionId({
        actionName: "verify",
        actionId: "my-custom-id",
      });
    </script>
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="setWithdraw" type="function(value: number | string): void">
  Accept formats like: `R$ 1,23`, `R$ 1.23`, `1.23`, `1,23`, `123`.

  Example:

  <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({
        /* ...options */
      });
      // Mount SDK
      sdkInstance.mount();
      sdkInstance.setWithdraw(123);
    </script>
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="setBalance" type="function(value: number | string): void">
  Accept formats like: `R$ 1,23`, `R$ 1.23`, `1.23`, `1,23`, `123`.

  Example:

  <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({
        /* ...options */
      });
      // Mount SDK
      sdkInstance.mount();
      sdkInstance.setBalance(123);
    </script>
    ```
  </CodeGroup>
</ResponseField>

<ResponseField name="closeModal" type="function(): void">
  It is responsible for closing the [OCR + Facematch validation](/sdk-reference/legitimuz/ocr-facematch) modal.

  Example:

  <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({
        /* ...options */
      });

      // Mount SDK
      sdkInstance.mount();

      // Close verification modal
      sdkInstance.closeModal();
    </script>
    ```
  </CodeGroup>
</ResponseField>
