Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions sdk/quickstart/javascript-dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,34 +162,16 @@ Set up your providers in `app/providers.tsx`:
"use client";

import { DynamicContextProvider } from "@dynamic-labs/sdk-react-core";
import { EthereumWalletConnectors, IEthereum } from "@dynamic-labs/ethereum";
import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
import { DynamicWagmiConnector } from "@dynamic-labs/wagmi-connector";
import { MetaMaskSDK } from "@metamask/sdk";
import { WagmiProvider } from "wagmi";
import { config } from "@/wagmi.config";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { useEffect } from "react";

export function Providers({ children }: { children: React.ReactNode }) {

const queryClient = new QueryClient();

useEffect(() => {
if (typeof window === "undefined") return;

const MMSDK = new MetaMaskSDK({
dappMetadata: {
name: "MetaMask Dynamic Integration",
url: window.location.href,
},
});

const ethereum = MMSDK.getProvider();
if (ethereum) {
window.ethereum = ethereum as unknown as IEthereum;
}
}, []);

return (
<DynamicContextProvider
settings={{
Expand Down
Loading