Nuxt
AppKit has support for Wagmi and Ethers v6 on Ethereum, @solana/web3.js on Solana and Bitcoin. Choose one of these to get started.AppKit for Nuxt requires SSR compatibility considerations. Make sure to use the
<client-only>
wrapper and configure your Nuxt app appropriately.Installation
Cloud Configuration
Create a new project on Reown Dashboard at https://dashboard.reown.com and obtain a new project ID.Implementation
Nuxt Wagmi Example
Check the Nuxt Wagmi example
nuxt.config.ts
:app.vue
file, set up AppKit:Make sure to set your
NUXT_PROJECT_ID
environment variable which you can get from Reown Dashboard.The
ssr: false
configuration and <client-only>
wrapper ensure AppKit works correctly with Nuxt’s SSR environment.Trigger the modal
The recommended way to trigger the modal in Nuxt is to use the<appkit-button />
web component wrapped in <client-only>
for SSR compatibility:
<appkit-button />
is a web component that’s automatically registered when AppKit is initialized. The <client-only>
wrapper ensures it only renders on the client side, preventing SSR hydration issues.
Alternative approaches
You can also trigger the modal programmatically using the AppKit composables:To open AppKit you can use our web component or build your own button with AppKit composables.
Web components are global html elements that don’t require importing. Make sure to wrap them in
<client-only>
for SSR compatibility.You can also use
<appkit-connect-button>
and <appkit-account-button>
components.Blockchain Interaction
You need to install @wagmi/core to interact with smart contracts:Wagmi actions can help us interact with wallets and smart contracts:For this use case, we need to import the Read more about Wagmi actions for smart contract interaction here.
wagmiConfig
from our AppKit WagmiAdapter configuration.