# Installation

import CloudBanner from '/snippets/cloud-banner.mdx'

import NuxtWagmiImplementation from '/snippets/appkit/nuxt/wagmi/about/implementation.mdx'

import NuxtEthersImplementation from '/snippets/appkit/nuxt/ethers/about/implementation.mdx'

import NuxtSolanaImplementation from '/snippets/appkit/nuxt/solana/about/implementation.mdx'

import NuxtBitcoinImplementation from '/snippets/appkit/nuxt/bitcoin/about/implementation.mdx'

import NuxtTonImplementation from '/snippets/appkit/nuxt/ton/about/implementation.mdx'

# Nuxt

AppKit has support for [Wagmi](https://wagmi.sh/) and [Ethers v6](https://docs.ethers.org/v6/) on Ethereum, [@solana/web3.js](https://solana-labs.github.io/solana-web3.js/) on Solana, Bitcoin and TON.
Choose one of these to get started.

<Note>
  AppKit for Nuxt requires SSR compatibility considerations. Make sure to use the `<client-only>` wrapper and configure your Nuxt app appropriately.
</Note>

## Installation

Try installing AppKit Skills to get AI-assisted guidance. Your AI coding assistant can help you set up, build, and debug your AppKit integration.

To install AppKit Skills, run the following command in your terminal:

```bash
npx skills add https://github.com/reown-com/skills --skill appkit --agent '*'
```

After installation, you can ask your AI assistant for help with AppKit setup, implementation, and troubleshooting.

<Tabs>
<Tab title="Wagmi">

<Warning>
  AppKit is only compatible with wagmi 2.x. Ensure you are using a compatible version.
</Warning>

<CodeGroup>

```bash npm
npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi@2.x viem @wagmi/vue @tanstack/vue-query
```

```bash Yarn
yarn add @reown/appkit @reown/appkit-adapter-wagmi wagmi@2.x viem @wagmi/vue @tanstack/vue-query
```

```bash Bun
bun add @reown/appkit @reown/appkit-adapter-wagmi wagmi@2.x viem @wagmi/vue @tanstack/vue-query
```

```bash pnpm
pnpm add @reown/appkit @reown/appkit-adapter-wagmi wagmi@2.x viem @wagmi/vue @tanstack/vue-query
```

</CodeGroup>

</Tab>
<Tab title="Ethers">

<CodeGroup>

```bash npm
npm install @reown/appkit @reown/appkit-adapter-ethers ethers
```

```bash Yarn
yarn add @reown/appkit @reown/appkit-adapter-ethers ethers
```

```bash Bun
bun add @reown/appkit @reown/appkit-adapter-ethers ethers
```

```bash pnpm
pnpm add @reown/appkit @reown/appkit-adapter-ethers ethers
```

</CodeGroup>

</Tab>
<Tab title="Solana">

<CodeGroup>

```bash npm
npm install @reown/appkit @reown/appkit-adapter-solana
```

```bash Yarn
yarn add @reown/appkit @reown/appkit-adapter-solana
```

```bash Bun
bun add @reown/appkit @reown/appkit-adapter-solana
```

```bash pnpm
pnpm add @reown/appkit @reown/appkit-adapter-solana
```

</CodeGroup>

</Tab>
<Tab title="Bitcoin">

<CodeGroup>

```bash npm
npm install @reown/appkit @reown/appkit-adapter-bitcoin
```

```bash Yarn
yarn add @reown/appkit @reown/appkit-adapter-bitcoin
```

```bash Bun
bun add @reown/appkit @reown/appkit-adapter-bitcoin
```

```bash pnpm
pnpm add @reown/appkit @reown/appkit-adapter-bitcoin
```

</CodeGroup>

</Tab>
<Tab title="TON">

<CodeGroup>

```bash npm
npm install @reown/appkit @reown/appkit-adapter-ton
```

```bash Yarn
yarn add @reown/appkit @reown/appkit-adapter-ton
```

```bash Bun
bun add @reown/appkit @reown/appkit-adapter-ton
```

```bash pnpm
pnpm add @reown/appkit @reown/appkit-adapter-ton
```

</CodeGroup>

</Tab>
</Tabs>

## Cloud Configuration

Create a new project on [Reown Dashboard](https://dashboard.reown.com) and obtain a new project ID.

<CloudBanner />

## Implementation

<Tabs>
<Tab title="Wagmi">
<Card title="Nuxt Wagmi Example" icon="github" href="https://github.com/reown-com/appkit/tree/main/examples/nuxt-wagmi-solana-bitcoin">
Check the Nuxt Wagmi example
</Card>

<NuxtWagmiImplementation />

</Tab>
<Tab title="Ethers">

<NuxtEthersImplementation />

</Tab>
<Tab title="Solana">
<Warning>
MetaMask does not currently support WalletConnect connections on Solana. The MetaMask team is working on adding this feature. In the meantime, we recommend using other wallets that support Solana. You can find the complete list of supported wallets on [WalletGuide](https://walletguide.walletconnect.network/).
</Warning>

<NuxtSolanaImplementation />

</Tab>
<Tab title="Bitcoin">

<NuxtBitcoinImplementation />

</Tab>
<Tab title="TON">

<NuxtTonImplementation />

</Tab>
</Tabs>

## Trigger the modal

<Note>
  AppKit for Nuxt requires SSR compatibility considerations. Make sure to use the `<client-only>` wrapper and configure your Nuxt app appropriately.
</Note>

<Tabs>
<Tab title="AppKit">

To open AppKit you can use our [**web components**](/appkit/vue/core/components) or build your own button with AppKit [**composables**](/appkit/vue/core/composables#useAppKit).

<CodeGroup>

```vue ConnectButton.vue
<template>
  <client-only>
    <appkit-button />
  </client-only>
</template>
```

```vue ConnectButtonWithComposables.vue
<script setup lang="ts">
import { useAppKit } from '@reown/appkit/vue'

const { open } = useAppKit()
</script>

<template>
  <client-only>
    <button @click="open()">Open Connect Modal</button>
    <button @click="open({ view: 'Networks' })">Open Network Modal</button>
  </client-only>
</template>
```

</CodeGroup>

<Note>
  The `<client-only>` wrapper ensures AppKit components only render on the client side, preventing SSR hydration issues.
</Note>

</Tab>
<Tab title="AppKit Core">

To open AppKit Core you need to call the `connect` function from the Universal Connector.

```vue
<script setup lang="ts">
import { ref } from 'vue'

let session = ref(null)

async function handleConnect() {
  // universalConnector is the universal connector instance from the implementation section
  if (!universalConnector) {
    return
  }

  const { session: providerSession } = await universalConnector.connect()
  session.value = providerSession
}

async function handleDisconnect() {
  if (!universalConnector) {
    return
  }
  await universalConnector.disconnect()
  session.value = null
}
</script>

<template>
  <client-only>
    <div>
      <button @click="handleConnect">Open AppKit Core</button>
      <button @click="handleDisconnect">Disconnect</button>
    </div>
  </client-only>
</template>
```

</Tab>
</Tabs>

## Blockchain Interaction

<Tabs>

<Tab title="Wagmi">
You need to install @wagmi/core to interact with smart contracts:

<CodeGroup>

```bash npm
npm install @wagmi/core
```

```bash Yarn
yarn add @wagmi/core
```

```bash Bun
bun add @wagmi/core
```

```bash pnpm
pnpm add @wagmi/core
```

</CodeGroup>

[Wagmi actions](https://wagmi.sh/core/api/actions/readContract) can help us interact with wallets and smart contracts:

For this use case, we need to import the `wagmiConfig` from our AppKit WagmiAdapter configuration.

```ts
import { readContract } from '@wagmi/core'
import { USDTAbi } from '../abi/USDTAbi'

const USDTAddress = '0x...'

const data = readContract(wagmiConfig, {
  address: USDTAddress,
  abi: USDTAbi,
  functionName: 'totalSupply',
  args: []
})
```

Read more about Wagmi actions for smart contract interaction [here](https://wagmi.sh/core/actions/readContract).

</Tab>
<Tab title="Ethers">

[Ethers](https://docs.ethers.org/v6/) can help us interact with wallets and smart contracts:

```ts
import { BrowserProvider, Contract, parseEther } from 'ethers'
import { useAppKitProvider, useAppKitAccount } from '@reown/appkit/vue'

const { walletProvider } = useAppKitProvider('eip155')
const { address } = useAppKitAccount()

if (!walletProvider) throw Error('No provider found')
if (!address) throw Error('No address found')

function sendTransaction() {
  const tx = {
    from: address,
    to: '0x...', // any address
    value: parseEther('0.0001')
  }
  const ethersProvider = new BrowserProvider(walletProvider)
  const signer = await ethersProvider.getSigner()
  const tx = await signer.sendTransaction(tx)
  console.log('transaction:', tx)
}
```

</Tab>
</Tabs>

## AppKit Skills

AppKit Skills provide AI-powered assistance for building with Reown AppKit. Once installed, your AI coding assistant can help you set up, build, and debug your AppKit integration.

To install AppKit Skills, run the following command in your terminal:

```bash
npx skills add https://github.com/reown-com/skills --skill appkit --agent '*'
```

After installation, you can ask your AI assistant for help with AppKit setup, implementation, and troubleshooting.
