Skip to content

Commit

Permalink
Update MetaMask Connector documentation (#4467)
Browse files Browse the repository at this point in the history
* Update MetaMask Connector documentation

* Update site/shared/connectors/metaMask.md

Co-authored-by: Alexandra Carrillo <[email protected]>

* Update site/shared/connectors/metaMask.md

Co-authored-by: Alexandra Carrillo <[email protected]>

* Update site/shared/connectors/metaMask.md

Co-authored-by: Alexandra Carrillo <[email protected]>

* Update site/shared/connectors/metaMask.md

Co-authored-by: Alexandra Carrillo <[email protected]>

* Update site/shared/connectors/metaMask.md

Co-authored-by: Alexandra Carrillo <[email protected]>

---------

Co-authored-by: Alexandra Carrillo <[email protected]>
  • Loading branch information
cxalem and alexandratran authored Dec 20, 2024
1 parent 9dcacff commit 2bb24d5
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions site/shared/connectors/metaMask.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ Check out the [MetaMask SDK docs](https://docs.metamask.io/wallet/connect/3rd-pa

### dappMetadata

`DappMetadata | undefined`
Metadata is used to fill details for the UX on confirmation screens in MetaMask, including the following fields:

Metadata about the dapp using the SDK, including, `name`, `url`, and `iconUrl`.
By default, `url` gets its value from `window.location.origin`.
- `name`: `string` - The name of the dapp.
- `url`: `string` - URL of the dapp (defaults to `window.location.origin`).
- `iconUrl`: `string` - URL to the dapp's favicon or icon.

```ts-vue
import { metaMask } from '{{connectorsPackageName}}'
Expand All @@ -60,16 +61,38 @@ const connector = metaMask({

### logging

`SDKLoggingOptions | undefined`
Enables SDK-side logging to provide visibility into:

Options for customizing the logging behavior of the SDK.
- RPC methods being called.
- Events received for syncing the chain or active account.
- Raw RPC responses.

In this context, this is especially useful to observe what calls are made through Wagmi hooks.

Relevant options:

```ts
{
developerMode: boolean, // Enables developer mode logs
sdk: boolean // Enables SDK-specific logs
}
```

```ts
import { metaMask } from '{{connectorsPackageName}}'

const connector = metaMask({
logging: { developerMode: true, sdk: true } // [!code focus]
})
```

### headless

`boolean | undefined`
- Enables headless mode, disabling MetaMask's built-in modal.
- Allows developers to create their own modal, such as for displaying a QR code.

This is particularly relevant for web-only setups using Wagmi, where developers want complete control over the UI.

Enables or disables headless mode.
Setting this to `true` disables the MetaMask modal, allowing you to create your own UI.
To get the deeplink to display in the QR code, listen to the `display_uri` event.

The default is `false`.
Expand All @@ -85,4 +108,9 @@ const connector = metaMask({
## Advanced

By default, if the EIP-6963 MetaMask injected provider is detected, this connector will replace it.

EIP-6963 defines a standard way for dapps to interact with multiple wallets simultaneously by injecting providers into the browser. Wallets that implement this standard can make their presence known to dapps in a consistent and predictable manner.

When MetaMask SDK detects an EIP-6963-compliant provider (such as MetaMask itself), the connector will automatically replace the default injected provider (like `window.ethereum`) with the one provided by MetaMask SDK.

See the [`rdns` property](https://wagmi.sh/dev/creating-connectors#properties) for more information.

0 comments on commit 2bb24d5

Please sign in to comment.