> For the complete documentation index, see [llms.txt](https://docs.aeternity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aeternity.com/developer-documentation/aepp-sdk-js/docs/guides/connect-aepp-to-wallet.md).

# Connect an æpp to a wallet

This guide describes the 4 steps that are necessary to connect your application to a wallet using the RPC API.

## Prerequisites

* Install [Superhero Wallet extension](https://wallet.superhero.com/) for simplicity of example.\
  You can build your own wallet in the next example

## 1. Specify imports and constants

{% @github-files/github-code-block url="<https://github.com/aeternity/aepp-sdk-js/blob/f60d1b8a1124b32781769342e4941c8dacf6ad53/examples/browser/aepp/src/StoreAeSdkPlugin.js#L1-L5>" %}

## 2. Initialize the `AeSdkAepp` class

{% @github-files/github-code-block url="<https://github.com/aeternity/aepp-sdk-js/blob/f60d1b8a1124b32781769342e4941c8dacf6ad53/examples/browser/aepp/src/StoreAeSdkPlugin.js#L34-L49>" %}

## 3. Scan for wallets and connect to a wallet

{% @github-files/github-code-block url="<https://github.com/aeternity/aepp-sdk-js/blob/f60d1b8a1124b32781769342e4941c8dacf6ad53/examples/browser/aepp/src/Connect.vue#L66-L85>" %}

Alternatively, aepp can request wallet to share node url it connected to. If agreed, then aepp can\
connect to the wallet's node.

```js
await this.aeSdk.connectToWallet(wallet.getConnection(), {
  connectNode: true,
  name: 'wallet-node',
  select: true,
});
```

It can be used to

* improve responsiveness by connecting to the exact node that wallet uses;
* allow to connect aepps to private/development networks without changing their configuration;
* simplify configuration on aepp side.

Note:

* The steps above are snippets taken from the full implementation of\
  the [Simple æpp](https://github.com/aeternity/aepp-sdk-js/blob/f60d1b8a1124b32781769342e4941c8dacf6ad53/examples/browser/aepp)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aeternity.com/developer-documentation/aepp-sdk-js/docs/guides/connect-aepp-to-wallet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
