Install Dynamic
Install Dynamic if the desired component you wish to use requires WEB3 wallet connectivity
Install web3 dependencies
Wagmi config setup
Create a new file for your Wagmi configuration.
For this example we will create a file named
config/index.tsx outside our app directory and set up the following configuration.In order for Dynamic to work properly you must first setup a
.env file in the root of your directory and create a variable named NEXT_PUBLIC_DYNAMIC_ID where you will pass in your Environment ID. You can get your Environment ID for free by visiting the Dynamic developer dashboard.Context provider setup
Let's create now a context provider that will wrap our application and initialize Dynamic with Wagmi integration.
In this example we will create a file named
context/index.tsx outside our app directory and set up the following configurationLayout setup
Next in our
app/layout.tsx file, we will import our ContextProvider component and wrap our application with it.Using the Dynamic Widget
To display a connect wallet button, you can use the
DynamicWidget component from Dynamic. Add it anywhere in your app where you want users to connect their wallet.The
DynamicWidget provides a complete wallet connection experience including wallet selection, connection status, and user profile. You can customize its appearance in the Dynamic dashboard design settings.