> For the complete documentation index, see [llms.txt](https://docs.tuum.tech/identify/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tuum.tech/identify/getting-started/application-setup.md).

# Application Setup

## Check whether Metamask is installed(OPTIONAL)

It's optional but recommended to verify whether MetaMask is installed by the users because Snaps are only available within Metamask. The choice is up to developers on how they want to handle this aspect of the integration.

```tsx
async function isMetamaskInstalled() {
  // Check if the `window.ethereum` property exists on the window object
  return typeof window.ethereum !== 'undefined' && window.ethereum.isMetaMask;
}
```

Check out [Snap RPC APIs](/identify/identify-snap/snap-rpc-apis.md) to learn about how to interact with the Identify Snap from your website.

## Add the Connect to Identify Snap button on your application

Note that before users can interact with the Identify Snap, it needs to first be installed on the Metamask itself so you can have a button on your website that lets users do exactly this.

```tsx
// Get permissions to interact with and install the Identify Snap
async function connect() {
  console.log("snap id", snapId);
  const isMetamaskDetected = await isMetamaskInstalled();
  if (!isMetamaskDetected ) {
    console.error(
      "You need to install Metamask for this demo to work. You can install it at https://metamask.io"
    );
    alert(
      "You need to install Metamask for this demo to work. You can install it at https://metamask.io"
    );
  }

  let snaps = await window.ethereum.request({
    method: "wallet_getSnaps"
  });
  console.log("Installed snaps...", snaps);
  try {
    if (!(snapId in snaps)) {
      console.log("Identify Snap is not yet installed. Installing now...");
      const result = await ethereum.request({
        method: "wallet_requestSnaps",
        params: {
          [snapId]: {}
        }
      });
      console.log("result: ", result);
      snaps = await window.ethereum.request({
        method: "wallet_getSnaps"
      });
    }
  } catch (e) {
    console.log(
      `Failed to obtain installed snap: ${JSON.stringify(e, null, 4)}`
    );
    alert(`Failed to obtain installed snap: ${JSON.stringify(e, null, 4)}`);
  }

  if (snapId in snaps) {
    console.log("Connected successfully!");
    alert("Connected successfully!");
  } else {
    console.log("Could not connect successfully. Please try again!");
    alert("Could not connect successfully. Please try again!");
  }
}
```

<details>

<summary>Some things to keep in mind while interacting with the above demo</summary>

* If you're getting any errors with the live demo, make sure you go through the [FAQs](/identify/basics/faqs.md) section to learn about what you may be missing. You need to install [Metamask](https://metamask.io/) in your browser for the live demo to wor

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tuum.tech/identify/getting-started/application-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
