diff --git a/site/shared/connectors/metaMask.md b/site/shared/connectors/metaMask.md index e710ca7a5e..8812cbc276 100644 --- a/site/shared/connectors/metaMask.md +++ b/site/shared/connectors/metaMask.md @@ -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}}' @@ -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`. @@ -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.