> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Open a URL in a Wallet Browser

> Open any page inside a wallet's in-app browser, addressed by the wallet's catalogue key.

`openUrlInWalletBrowser` opens a page inside a wallet's in-app browser, addressed by the wallet's catalogue key. Use it when you already know the URL to open; to route the user into a wallet browser as part of connecting, see [Connect a wallet by catalogue key](https://www.dynamic.xyz/docs/javascript/reference/wallets/connect-wallet-option.md).

The call is only available on mobile: elsewhere the wallet exposes no in-app browser, so it throws `NoConnectionOptionAvailableError`.

## Usage

```typescript theme={"system"}
import { openUrlInWalletBrowser } from '@dynamic-labs-sdk/client';

await openUrlInWalletBrowser({
  url: 'https://www.fireblocks.com',
  walletKey: 'metamask',
});
```

Wallet keys come from `getWalletOptionsCatalogue` — see [Get wallet options catalogue](https://www.dynamic.xyz/docs/javascript/reference/wallets/get-wallet-options-catalogue.md).

## Parameters

| Name | Type | Default | Description |
| - | - | - | - |
| `url` | `string` | — | The page for the wallet's in-app browser to open. |
| `walletKey` | `string` | — | The wallet to open, keyed as in the wallet options catalogue. |

## Errors

| Error | Condition |
| - | - |
| `WalletOptionNotFoundError` | No wallet option matches `walletKey`. |
| `NoConnectionOptionAvailableError` | The wallet exposes no in-app browser, as on desktop. |
| `AmbiguousWalletChainError` | The wallet's in-app browser differs between the client's chains, and no chain can be passed. |
| `UnsafeDeeplinkUrlError` | The wallet's in-app-browser URL has a scheme that can execute script. |

## React

`useOpenUrlInWalletBrowser` wraps `openUrlInWalletBrowser` as a mutation. Pass the open parameters to `mutate`, and optional react-query overrides (`onSuccess`, `onError`, `retry`, and so on) through `mutateParams`.

```tsx theme={"system"}
import { useOpenUrlInWalletBrowser } from '@dynamic-labs-sdk/react-hooks';

function OpenInWalletButton() {
  const { error, mutate: openUrlInWalletBrowser } = useOpenUrlInWalletBrowser();

  return (
    <button
      onClick={() =>
        openUrlInWalletBrowser(
          { url: 'https://www.fireblocks.com', walletKey: 'metamask' },
          { onError: (err) => console.error(err) }
        )
      }
    >
      Open in wallet
    </button>
  );
}
```

## See also

* [Get wallet options catalogue](https://www.dynamic.xyz/docs/javascript/reference/wallets/get-wallet-options-catalogue.md)
* [Connect a wallet by catalogue key](https://www.dynamic.xyz/docs/javascript/reference/wallets/connect-wallet-option.md)
* [Connect and verify a wallet](https://www.dynamic.xyz/docs/javascript/reference/wallets/connect-and-verify-wallet.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.