> ## 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 further customize the SDK

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

  Example:

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

<ResponseField name="setLang" type="function(lang: 'pt' | 'en' | 'es'): void">
  Responsible for changing the language of the [Face Index](/introduction) flow.

  Example:

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

<ResponseField name="closeModal" type="function(): void">
  Responsible for closing the [Face Index](/introduction) modal.

  Example:

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

<ResponseField name="changeFieldId" type="function(params: object): void">
  Change the [id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)
  of the field used to extract the CPF.

  <Expandable title="params">
    <ResponseField name="fieldName" type="string" required>
      Name of the field

      [Click here](/fields) to see the available fields
    </ResponseField>

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

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

  Example:

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

<ResponseField name="startFaceIndex" type="function(params: object): void">
  Start the [Face Index](/introduction) flow via JavaScript.

  <Expandable title="params">
    <ResponseField name="cpf" type="string" required>
      User's CPF

      Example: `12345678901`

      [Click here](/fields) to see the available fields
    </ResponseField>

    <ResponseField name="referenceId" type="string | null" default="null">
      Field used for custom identifiers

      Example: `fake-user-id`
    </ResponseField>
  </Expandable>

  Example:

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