> For the complete documentation index, see [llms.txt](https://docs.polkagate.xyz/polkagate/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.polkagate.xyz/polkagate/metamask-snap-user-guide/how-to-integrate-my-dapp-with-polkagate-snap.md).

# How to Integrate My dApp with PolkaGate snap

To connect with the injected Snap, start by adding the `@polkagate/extension-dapp` package to your dApp. Use `web3Enable('your-app-name')` to fetch the injected extensions, including PolkaGate Snap. If you only want to enable the Snap and not other extensions, call `web3Enable('snapOnly')`. After that, you can access your Snap account(s) using `web3Accounts()`. Below is a simple code example illustrating these processes:

<pre><code>import { web3Accounts, web3Enable } from '@polkagate/extension-dapp';

<strong>web3Enable('your-dapp-name').then((extensions) => {
</strong>  console.log('All injected extensions:', extensions);
});

web3Accounts().then((accounts) => {
  const account = accounts.find((acc) => acc.meta.source === 'polkagate-snap');
  console.info('Snap account:', account);
});
</code></pre>

This integration allows your dApp to interact seamlessly with the PolkaGate snap through the injected information within the window. These are familiar calls if you've worked with other existing Polkadot ecosystem extensions. The rest remains the same.


---

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

```
GET https://docs.polkagate.xyz/polkagate/metamask-snap-user-guide/how-to-integrate-my-dapp-with-polkagate-snap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
