> ## 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="apiURL" type="string" required>
  This 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="action" type="string">
  The action you want to perform.

  The available actions:

  * `signin`: login action
  * `signup`: registration action
  * `deposit`: deposit action
  * `withdraw`: withdrawal action
  * `bet`: Bet action
  * `bet_profit`: Bet profit action
  * `bet_loss`: Bet loss action
  * `check`: **must be send** every 30 minutes

  Examples:

  <CodeGroup>
    ```html HTML theme={null}
    <script src="https://cdn.legitimuz.com/js/sdk/antifraude.js"></script>
    <script type="text/javascript">
      const sdkInstance = LegitimuzAntiFraude({
        /* options */
        action: 'signin',
      });

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

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

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

      const handleOnLoadSDK = () => {
        sdkInstance.current = LegitimuzAntiFraude({
          /* options */
          action: 'signin',
        });

        // Mount the SDK
        sdkInstance.current.mount();
      }

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

<ResponseField name="enableRequestGeolocation" type="boolean" default="false">
  The `enableRequestGeolocation` option allows you to enable or disable the request for the user's geolocation.

  **Highly recommended to stay true.**

  Examples:

  <CodeGroup>
    ```html HTML theme={null}
    <script src="https://cdn.legitimuz.com/js/sdk/antifraude.js"></script>
    <script type="text/javascript">
      const sdkInstance = LegitimuzAntiFraude({
        /* options */
        action: 'signin',
        enableRequestGeolocation: true,
      });

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

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

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

      const handleOnLoadSDK = () => {
        sdkInstance.current = LegitimuzAntiFraude({
          /* options */
          action: 'signin',
          enableRequestGeolocation: true,
        });

        // Mount the SDK
        sdkInstance.current.mount();
      }

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

<ResponseField name="eventHandler" type="function: (event: object): void">
  The `eventHandler` option allows you to receive events from the SDK.

  <Expandable title="events">
    <ResponseField name="geolocation-denied">
      The user denied the geolocation permission

      ```javascript theme={null}
      {
        eventId: "geolocation-denied",
        name: "geolocation",
        data: {
          permission // granted, denied, prompt
        }
      }
      ```
    </ResponseField>

    <ResponseField name="geolocation-not-available">
      The browser did not send the geolocation coordinates

      ```javascript theme={null}
      {
        eventId: "geolocation-not-available",
        name: "geolocation",
        data: {
          permission // granted, denied, prompt
        }
      }
      ```
    </ResponseField>

    <ResponseField name="api-error">
      Error in the API

      ```javascript theme={null}
      {
        eventId: "api-error",
        name: "error",
        data: {
          message // error message
        }
      }
      ```
    </ResponseField>

    <ResponseField name="sdk-internal-error">
      Error in the SDK

      ```javascript theme={null}
      {
        eventId: "sdk-internal-error",
        name: "error",
        data: {
          error, // error object
          message // error message
        }
      }
      ```
    </ResponseField>
  </Expandable>

  Examples:

  <CodeGroup>
    ```html HTML theme={null}
    <script src="https://cdn.legitimuz.com/js/sdk/antifraude.js"></script>
    <script type="text/javascript">
      const sdkInstance = LegitimuzAntiFraude({
        /* options */
        action: 'signin',
        enableRequestGeolocation: true,
        eventHandler: event => {
          console.log(event); // { eventId: string; name: string, data: object }
        }
      });

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

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

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

      const handleOnLoadSDK = () => {
        sdkInstance.current = LegitimuzAntiFraude({
          /* options */
          action: 'signin',
          enableRequestGeolocation: true,
          eventHandler: event => {
            console.log(event); // { eventId: string; name: string, data: object }
          }
        });

        // Mount the SDK
        sdkInstance.current.mount();
      }

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