# connectWallet

```javascript
(async() => {
    await SOLPay.connectWallet(); // {"address": "..."}
    await SOLPay.connectWallet(SOLPay.adapters.PHANTOM); // {"address": "..."}
})();
```

### Parameters:

* adapter (optional, default: `SOLPay.adapters.CURRENT_ADAPTER || SOLPay.adapters.PHANTOM`) - the wallet to use for the connection
  * Current Adapter: `SOLPay.adapters.CURRENT_ADAPTER` (or leave the adapter field blank)
  * Phantom: `SOLPay.adapters.PHANTOM`
  * Solflare: `SOLPay.adapters.SOLFLARE`
  * Slope: `SOLPay.adapters.SLOPE`
  * Glow: `SOLPay.adapters.GLOW`
  * Exodus: `SOLPay.adapters.EXODUS`
  * Brave: `SOLPay.adapters.BRAVE`

{% hint style="info" %}
**Adapters:**

For more information on adapters, see [adapters](/reference/sdk-reference/adapters.md).
{% endhint %}

### Returns:

object (`{"address": "..."}`) - the wallet details for the connected wallet

* address: string (`"..."`) - the address of the wallet

### Throws:

* `SOL Pay SDK Fatal Error: Invalid adapter ${adapter}.` - an invalid adapter was used
* `SOL Pay SDK Fatal Error: No adapter found.` - could not find an adapter
* `SOL Pay SDK Fatal Error: Solana wallet not found!` - could not find the wallet installed in the user's browser
* `SOL Pay SDK Fatal Error: Could not connect to Solana wallet!` - could not connect to the wallet

### Side Effects:

* SOL Pay will attempt to open the wallet's official website in a new window if it cannot find the wallet installed in the browser (`SOL Pay SDK Fatal Error: Solana wallet not found!`).
  * Phantom: [phantom.app](https://phantom.app/)
  * Solflare: [solflare.com](https://solflare.com/)
  * Slope: [slope.finance](https://slope.finance/)
  * Glow: [glow.app](https://glow.app/)
  * Exodus: [www.exodus.com/browser-extension](https://www.exodus.com/browser-extension/)
  * Brave: [brave.com/wallet](https://brave.com/wallet)


---

# Agent Instructions: 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://solpay-docs.solblaze.org/reference/sdk-reference/connect-wallet.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.
