NextJS
The procedure for adding the Kima Transaction Widget to a NextJS app is very similar to the React tutorial but you should be aware that you will need to export the widget component as a dynamic component with {ssr: false}
so that the application runs the widget on the client side.
To create a new app, you can run npx create-next-app <your-app-name>
. Then install the Kima Widget and its peer dependencies.
You'll need to add the following:
The
<KimaProvider>
component inApp.tsx
The
<KimaTransactionWidget>
which interacts with KimaA link to the Kima Transaction Backend (or build your own)
A WalletConnect project id
If you don't have one already, you'll need to get a (free) WallectConnect project ID from Reown Cloud and add it to the <KimaProvider walletConnectProjectId='your-project-id' />
component.
Within your app
directory, create a components
directory and inside that create a file named widget.jsx
with the following code:
Copy
You can now use DynamicApp
on whatever page you like. In our example, we will create an index page index.jsx
in our pages
directory and copy the following code:
Copy
When you visit localhost:3000
you will see something like this:
See the Configuration options section for more details on setting up the widget.
Last updated