Skip to content

Commit 03a1139

Browse files
committed
Merge branch 'main' into migrate-gator
# Conflicts: # docs/whats-new.md
2 parents cd23897 + 6816a5f commit 03a1139

25 files changed

Lines changed: 1323 additions & 378 deletions

File tree

docs/whats-new.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,20 @@ The latest major MetaMask documentation updates are listed by the month they wer
99
For a comprehensive list of recent product changes, visit the "Release Notes" section at the bottom
1010
of the [MetaMask developer page](https://metamask.io/developer/).
1111

12-
## May 2025
12+
## June 2025
1313

1414
- Added [Delegation Toolkit](/gator) to MetaMask documentation.
1515
([#2045](https://github.com/MetaMask/metamask-docs/pull/2045))
16+
17+
## May 2025
18+
19+
- Documented Multichain API [guide](/wallet/how-to/manage-networks/use-multichain),
20+
[concept](/wallet/concepts/multichain-api), and [reference](/wallet/reference/multichain-api).
21+
([#1621](https://github.com/MetaMask/metamask-docs/pull/1621))
22+
- Documented [Solana](/wallet/how-to/use-non-evm-networks/solana) dapp support via the Wallet Standard and third-party libraries.
23+
([#1940](https://github.com/MetaMask/metamask-docs/pull/1940))
24+
- Documented [MetaMask SDK + Web3Auth SDK integration](/sdk/quickstart/javascript-web3auth).
25+
([#2029](https://github.com/MetaMask/metamask-docs/pull/2029))
1626
- Documented [how to use the Snaps sandbox](/snaps/how-to/test-a-snap/#test-in-the-sandbox).
1727
([#2030](https://github.com/MetaMask/metamask-docs/pull/2030))
1828
- Documented how to use the SDK CLI to set up a [JavaScript + Wagmi](/sdk/quickstart/javascript-wagmi) or [Dynamic SDK](/sdk/quickstart/javascript-dynamic) project.

package-lock.json

Lines changed: 250 additions & 323 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@mdx-js/react": "^3.1.0",
4040
"@metamask/design-tokens": "^7.1.0",
4141
"@metamask/eth-sig-util": "^7.0.3",
42-
"@metamask/profile-sync-controller": "^11.0.1",
42+
"@metamask/profile-sync-controller": "^16.0.0",
4343
"@metamask/sdk": "^0.32.0",
4444
"@rjsf/core": "^5.24.10",
4545
"@rjsf/utils": "^5.24.8",
@@ -87,7 +87,7 @@
8787
"stylelint": "^15.0.0 ",
8888
"stylelint-config-standard": "^34.0.0",
8989
"tsc-files": "^1.1.4",
90-
"typescript": "^5.8.2"
90+
"typescript": "^5.8.3"
9191
},
9292
"overrides": {
9393
"react-alert": {

sdk-sidebar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const sidebar = {
2929
'quickstart/javascript-wagmi',
3030
'quickstart/javascript',
3131
'quickstart/javascript-dynamic',
32+
'quickstart/javascript-web3auth',
3233
'quickstart/react-native',
3334
],
3435
},
998 KB
Loading

sdk/introduction/welcome.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ You can get started quickly with the following dapp platforms:
3434
- [JavaScript + Wagmi (recommended)](quickstart/javascript-wagmi.md)
3535
- [JavaScript](quickstart/javascript.md)
3636
- [Dynamic SDK integration](quickstart/javascript-dynamic.md)
37+
- [Web3Auth SDK integration](quickstart/javascript-web3auth.md)
3738
- [React Native](quickstart/react-native.md)

sdk/quickstart/javascript-dynamic.md

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can set up the SDKs in the following ways:
1919

2020
Features include:
2121

22-
- **Dual SDK integration** - Seamlessly combine MetaMask and Dynamic SDKs.
22+
- **MetaMask SDK built into Dynamic** - Use MetaMask SDK features directly within the Dynamic SDK.
2323
- **Wallet connection** - Connect to MetaMask wallet with enhanced features.
2424
- **Mobile experience** - Optimized for both desktop and mobile users.
2525
- **TypeScript support** - Full type safety and modern development experience.
@@ -43,10 +43,11 @@ The project you will set up has the following structure:
4343

4444
## Prerequisites
4545

46-
- [Node.js](https://nodejs.org/) version 19 or later
47-
- [pnpm](https://pnpm.io/installation)
48-
- [MetaMask](https://metamask.io/) installed in your browser or on mobile
49-
- A [Dynamic Environment ID](https://app.dynamic.xyz/)
46+
- [Node.js](https://nodejs.org/) version 19 or later installed.
47+
- A package manager installed.
48+
The examples in this quickstart use [pnpm](https://pnpm.io/installation).
49+
- [MetaMask](https://metamask.io/) installed in your browser or on mobile.
50+
- A [Dynamic Environment ID](https://app.dynamic.xyz/).
5051

5152
## Set up using the CLI
5253

@@ -161,34 +162,16 @@ Set up your providers in `app/providers.tsx`:
161162
"use client";
162163
163164
import { DynamicContextProvider } from "@dynamic-labs/sdk-react-core";
164-
import { EthereumWalletConnectors, IEthereum } from "@dynamic-labs/ethereum";
165+
import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
165166
import { DynamicWagmiConnector } from "@dynamic-labs/wagmi-connector";
166-
import { MetaMaskSDK } from "@metamask/sdk";
167167
import { WagmiProvider } from "wagmi";
168168
import { config } from "@/wagmi.config";
169169
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
170-
import { useEffect } from "react";
171170
172171
export function Providers({ children }: { children: React.ReactNode }) {
173172
174173
const queryClient = new QueryClient();
175174
176-
useEffect(() => {
177-
if (typeof window === "undefined") return;
178-
179-
const MMSDK = new MetaMaskSDK({
180-
dappMetadata: {
181-
name: "MetaMask Dynamic Integration",
182-
url: window.location.href,
183-
},
184-
});
185-
186-
const ethereum = MMSDK.getProvider();
187-
if (ethereum) {
188-
window.ethereum = ethereum as unknown as IEthereum;
189-
}
190-
}, []);
191-
192175
return (
193176
<DynamicContextProvider
194177
settings={{

sdk/quickstart/javascript-wagmi.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ The project you will set up has the following structure:
4343

4444
## Prerequisites
4545

46-
- [Node.js](https://nodejs.org/) version 19 or later
47-
- [pnpm](https://pnpm.io/installation)
48-
- [MetaMask](https://metamask.io/) installed in your browser or on mobile
46+
- [Node.js](https://nodejs.org/) version 19 or later installed.
47+
- A package manager installed.
48+
The examples in this quickstart use [pnpm](https://pnpm.io/installation).
49+
- [MetaMask](https://metamask.io/) installed in your browser or on mobile.
4950

5051
## Set up using the CLI
5152

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
---
2+
sidebar_label: Web3Auth SDK integration
3+
description: Quickstart guide for using MetaMask SDK and Web3Auth SDK.
4+
toc_max_heading_level: 2
5+
---
6+
7+
# MetaMask SDK + Web3Auth SDK integration
8+
9+
Get started with MetaMask SDK and [Web3Auth SDK](https://web3auth.io/docs/).
10+
You can set up the SDKs in the following ways:
11+
12+
- [Quickstart template](#set-up-using-a-template) - Clone the template to set up a Next.js and Web3Auth dapp that uses MetaMask SDK.
13+
- [Manual setup](#set-up-manually) - Set up Web3Auth SDK in an existing dapp.
14+
15+
<p align="center">
16+
<img src={require("../_assets/quickstart-web3auth.png").default} alt="Web3Auth SDK Quickstart" width="450px" />
17+
</p>
18+
19+
Features include:
20+
21+
- **MetaMask SDK built into Web3Auth** - Use MetaMask SDK features directly within the Web3Auth SDK.
22+
- **Web3Auth social login** - Enable users to sign in with an email or social media account.
23+
- **Wallet connection** - Connect to MetaMask wallet with enhanced features.
24+
- **Mobile experience** - Optimized for both desktop and mobile users.
25+
- **TypeScript support** - Full type safety and modern development experience.
26+
- **Next.js integration** - Built with Next.js 15 and App Router.
27+
28+
## Prerequisites
29+
30+
- [Node.js](https://nodejs.org/) version 19 or later installed.
31+
- A package manager installed.
32+
The examples in this quickstart use [pnpm](https://pnpm.io/installation).
33+
- [MetaMask](https://metamask.io/) installed in your browser or on mobile.
34+
- A [Web3Auth Client ID](https://web3auth.io/docs/dashboard/create-new-project#get-the-client-id).
35+
36+
## Set up using a template
37+
38+
1. Download the [MetaMask SDK + Web3Auth SDK template](https://github.com/MetaMask/metamask-web3auth):
39+
40+
```bash
41+
git clone https://github.com/MetaMask/metamask-web3auth
42+
```
43+
44+
2. Navigate into the repository:
45+
46+
```bash
47+
cd metamask-web3auth
48+
```
49+
50+
3. Install dependencies:
51+
52+
```bash
53+
pnpm install
54+
```
55+
56+
4. Create a `.env.local` file:
57+
58+
```bash
59+
touch .env.local
60+
```
61+
62+
5. In `.env.local`, add a `NEXT_PUBLIC_WEB3AUTH_CLIENT_ID` environment variable, replacing `<YOUR-CLIENT-ID>` with your Web3Auth Client ID:
63+
64+
```text title=".env.local"
65+
NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=<YOUR-CLIENT-ID>
66+
```
67+
68+
6. Run the project:
69+
70+
```bash
71+
pnpm dev
72+
```
73+
74+
You've successfully set up MetaMask SDK and Web3Auth SDK.
75+
See how to [use the combined SDKs](#usage).
76+
77+
## Set up manually
78+
79+
### 1. Install dependencies
80+
81+
Install the SDK and the required dependencies to an existing project:
82+
83+
```bash
84+
pnpm i viem wagmi @tanstack/react-query @web3auth/modal@10
85+
```
86+
87+
### 2. Configure providers
88+
89+
Set up your providers in `app/providers.tsx`:
90+
91+
```typescript title="providers.tsx"
92+
"use client";
93+
94+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
95+
import { type ReactNode, useState } from "react";
96+
import { Web3AuthProvider } from "@web3auth/modal/react";
97+
import { WagmiProvider } from "@web3auth/modal/react/wagmi";
98+
99+
type Props = {
100+
children: ReactNode;
101+
};
102+
103+
export function Providers({ children }: Props) {
104+
const [queryClient] = useState(() => new QueryClient());
105+
106+
return (
107+
<Web3AuthProvider
108+
config={{
109+
web3AuthOptions: {
110+
clientId: process.env.NEXT_PUBLIC_WEB3AUTH_CLIENT_ID!,
111+
web3AuthNetwork: "sapphire_devnet"
112+
},
113+
}}
114+
>
115+
<QueryClientProvider client={queryClient}>
116+
<WagmiProvider>
117+
<div className="container">{children}</div>
118+
</WagmiProvider>
119+
</QueryClientProvider>
120+
</Web3AuthProvider>
121+
);
122+
}
123+
```
124+
125+
### 3. Set up environment variables
126+
127+
Create a `.env.local` file.
128+
In `.env.local`, add a `NEXT_PUBLIC_WEB3AUTH_CLIENT_ID` environment variable, replacing `<YOUR-CLIENT-ID>` with your Web3Auth Client ID:
129+
130+
```text title=".env.local"
131+
NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=<YOUR-CLIENT-ID>
132+
```
133+
134+
You can now test your dapp by running `pnpm run dev`.
135+
136+
## Usage
137+
138+
### Connect or sign in
139+
140+
Use the `useWeb3AuthConnect` hook to enable users to connect or sign in to their wallet:
141+
142+
```typescript
143+
"use client";
144+
145+
import { useWeb3AuthConnect } from "@web3auth/modal/react";
146+
147+
export const Navbar = () => {
148+
const { connect } = useWeb3AuthConnect();
149+
150+
return (
151+
<nav>
152+
<button onClick={() => connect()}>Connect or Sign in</button>;
153+
</nav>
154+
);
155+
};
156+
```
157+
158+
### Check wallet status
159+
160+
Use the `useAccount` hook from Wagmi to check the wallet status:
161+
162+
```typescript
163+
"use client";
164+
165+
import { useAccount } from "wagmi";
166+
167+
export const Hero = () => {
168+
const { address, isConnected } = useAccount();
169+
170+
return (
171+
<div>
172+
{isConnected ? <p>Connected: {address}</p> : <p>Not connected</p>}
173+
</div>
174+
);
175+
};
176+
```
177+
178+
### Send a transaction
179+
180+
Use the `useSendTransaction` hook from Wagmi to send a transaction:
181+
182+
```typescript
183+
"use client";
184+
185+
import { useSendTransaction } from "wagmi";
186+
import { parseEther } from "viem";
187+
188+
export const SendTransaction = () => {
189+
const { sendTransaction } = useSendTransaction();
190+
191+
return (
192+
<button
193+
onClick={() =>
194+
sendTransaction({
195+
to: "0xd2135CfB216b74109775236E36d4b433F1DF507B",
196+
value: parseEther("0.001"),
197+
})
198+
}
199+
>
200+
Send transaction
201+
</button>
202+
);
203+
};
204+
```

snaps/features/custom-ui/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ The SVG is rendered within an `<img>` tag, which prevents JavaScript or interact
857857
being supported.
858858
859859
:::note
860-
To disable image support, set the [`features.images`](../../reference/cli/options.md#featuresimages)
860+
To disable image support, set the [`features.images`](../../reference/config-options.md#featuresimages)
861861
configuration option to `false`.
862862
The default is `true`.
863863
:::

0 commit comments

Comments
 (0)