> For the complete documentation index, see [llms.txt](https://support.backpack.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.backpack.exchange/support-docs/es/wallet/documentacion-tecnica/deeplinks/provider-methods/connect.md).

# Connect

Before an app can interact with Backpack, it must first establish a connection. This connection request prompts the user to share their public key, signaling their consent to proceed.&#x20;

Once the user connects, Backpack provides a session parameter that should be used for all subsequent methods.

{% hint style="info" %}
Please see [Handling Sessions](/support-docs/es/wallet/documentacion-tecnica/deeplinks/handling-sessions.md) for more information on sessions.
{% endhint %}

## Base URL

```
https://backpack.app/ul/v1/connect
```

## Query String Parameters

* `app_url` (required): A URL that provides app metadata (e.g., title, icon). It must be URL-encoded.
* `dapp_encryption_public_key` (required): A public key for end-to-end encryption, used to generate a shared secret. Refer to the [Encryption](/support-docs/es/wallet/documentacion-tecnica/deeplinks/encryption.md) section for details on how Backpack manages shared secrets.
* `redirect_link` (required): The URI where Backpack should redirect the user upon connection. See [Specifying Redirects](/support-docs/es/wallet/documentacion-tecnica/deeplinks/specifying-redirects.md) for more details. Must be URL-encoded.
* `cluster` (optional): Specifies the network for subsequent interactions. To connect to Solana mainnet, leave the parameter unset or set it to `mainnet-beta`. To connect to Eclipse, set the parameter to `solana:EAQLJCV2mh23BsK2P9oYpV5CHVLDNHTxY`.

## Returns

### Approve

* `wallet_xxx`: A base58-encoded encryption public key used by Backpack to build a shared secret between the connecting app and Backpack.
* `nonce`: A nonce encoded in base58 that is used to encrypt the response.
* `data`: JSON string that has been encrypted. Learn how apps can decrypt data using a shared secret in [Encryption](/support-docs/es/wallet/documentacion-tecnica/deeplinks/encryption.md). Base58 is used to encode encrypted bytes.

  ```
  // content of decrypted `data`-parameter
  {
    // base58 encoding of user public key
    "public_key": "3huUrtWW5s5ew98eUFRYz9LPsDUQTujNzzYaB9DBkppQ",

    // session token for subsequent signatures and messages
    // apps should send this with any other deeplinks after connect
    "session": "..."
  }
  ```

  * `public_key`: The user's public key, represented as a base58-encoded string.
  * `session`: A string encoded in base58. This should be treated as opaque by the connecting app, as it only needs to be passed alongside other parameters. Sessions do not expire. For more information on sessions, please review [Handling Sessions](/support-docs/es/wallet/documentacion-tecnica/deeplinks/handling-sessions.md).

### Reject

An `errorCode` and `errorMessage` as query parameters.

Please refer to [Errors](/support-docs/es/wallet/documentacion-tecnica/deeplinks/limitations.md#errors) for a full list of possible error codes.


---

# 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://support.backpack.exchange/support-docs/es/wallet/documentacion-tecnica/deeplinks/provider-methods/connect.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.
