# Connect Wallet

{% hint style="info" %}
When using the API, you need to ensure that the browser has successfully obtained the **`window.mina`** object.
{% endhint %}

The presence of the mina provider object `window.mina`, in a user's browser indicates an Mina Protocol user.

To demonstrate this, verify whether your browser is running Auro Wallet by copying and pasting the following code snippet into your browser's developer console.

```javascript
if (typeof window.mina !== 'undefined') {
  console.log('Auro Wallet is installed!');
}
```

## Request Account

Interactive with Auro Wallet require connect account. This method returns an array when user confirm authorizes, which contains address that authenticated. The current array returns one address at a time. Returns a ProviderError when user reject authorization.

```typescript
const account:string[]|ProviderError = await window.mina.requestAccounts()
    .catch((err: any) => err);

console.log(account)
```

{% hint style="info" %}
**requestAccounts** will show a popup window when Auro Wallet lock or have no connected account, if you want to request account without popup window. You can use [getAccounts](/general/reference/api-reference/methods/mina_accounts.md).
{% endhint %}

```javascript
let account = await window.mina?.getAccounts();

console.log(account);
```

## Account Event

This method is used to monitor account changes. When the account changes, the monitoring will be trigger.

```typescript
window.mina?.on("accountsChanged", (accounts: string[]) => {
    console.log(accounts);
});
```


---

# 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://docs.aurowallet.com/general/howto/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.
