> For the complete documentation index, see [llms.txt](https://docs.heyelsa.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.heyelsa.ai/elsa-widget/sample-implementation.md).

# Sample Implementation

**Example Implementation**: <https://github.com/HeyElsa/elsa-widget-testdapp>

This is a chain-agnostic implementation and any type of wallet can be integrated. Both dApps with browser wallets and dApps with embedded wallets (e.g scribble) can implement it. For wallet-related transactions like sign transaction, connect wallet etc, the widget sends requests to the dApp through events and the dApp processes these events and sends back the response. Security-related content has been updated in the technical docs. Complete implementation of the widget is available in the [Example code](https://github.com/HeyElsa/elsa-widget-testdapp). Features implemented are:

1. Knowledge base querying,
2. Actions: Send and Swap transactions are covered.

Supported chains in the widget are :

1. Ethereum
2. Base
3. Soneium
4. Polygon


---

# 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.heyelsa.ai/elsa-widget/sample-implementation.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.
