# Installation

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

import WagmiImplementation from '/snippets/appkit/vue/wagmi/about/implementation.mdx'

import Ethers5Implementation from '/snippets/appkit/vue/ethers5/implementation.mdx'

import EthersImplementation from '/snippets/appkit/vue/ethers/about/implementation.mdx'
import SolanaImplementation from '/snippets/appkit/vue/solana/implementation.mdx'
import SolanaPrograms from '/snippets/appkit/vue/solana/programs.mdx'

import BitcoinImplementation from '/snippets/appkit/vue/bitcoin/about/implementation.mdx'

import TonImplementation from '/snippets/appkit/vue/ton/about/implementation.mdx'

import TronImplementation from '/snippets/appkit/vue/tron/about/implementation.mdx'

## Introduction

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, TON and TRON.
Choose one of these to get started.

## 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.

## Custom Installation

<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 @tanstack/vue-query @wagmi/vue viem
```

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

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

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

</CodeGroup>

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

<CodeGroup>

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

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

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

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

</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>
<Tab title="TRON">

<CodeGroup>

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

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

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

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

</CodeGroup>

</Tab>
</Tabs>

<CloudBanner />

## Cloud Configuration

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

## Implementation

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

<WagmiImplementation />

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

<Ethers5Implementation />

</Tab>
<Tab title="Ethers">
<Card title="ethers Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/vue/vue-ethers">
Check the Vue ethers example
</Card>

<EthersImplementation />

</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>

<Card title="Solana Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/vue/vue-solana">
Check the Vue Solana example
</Card>
<SolanaImplementation />

</Tab>
<Tab title="Bitcoin">
<Card title="Bitcoin Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/vue/vue-bitcoin">
Check the Vue Bitcoin example
</Card>

<BitcoinImplementation />

</Tab>
<Tab title="TON">
<Card title="TON Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/vue/vue-ton">
Check the Vue TON example
</Card>

<TonImplementation />

</Tab>
<Tab title="TRON">

<TronImplementation />

</Tab>
</Tabs>

## Trigger the modal

<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>
  <appkit-button />
</template>
```

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

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

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

</CodeGroup>

</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>
  <div>
    <button @click="handleConnect">Open AppKit Core</button>
    <button @click="handleDisconnect">Disconnect</button>
  </div>
</template>
```

</Tab>
</Tabs>

## Smart Contract Interaction

<Tabs>
<Tab title="Wagmi">

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

```html
<script setup lang="ts">
  import { readContract } from '@wagmi/core'
  import { USDTAbi } from '../abi/USDTAbi'

  const USDTAddress = '0x...'

  const data = readContract({
    abi: USDTAbi,
    address: USDTAddress,
    functionName: 'symbol'
  })
</script>
```

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:

```html
<script setup lang="ts">
  import { useAppKitProvider, useAppKitAccount } from '@reown/appkit/vue'
  import { BrowserProvider, Contract, formatUnits } from 'ethers'

  const USDTAddress = '0x617f3112bf5397D0467D315cC709EF968D9ba546'

  // The ERC-20 Contract ABI, which is a common contract interface
  // for tokens (this is the Human-Readable ABI format)
  const USDTAbi = [
    'function name() view returns (string)',
    'function symbol() view returns (string)',
    'function balanceOf(address) view returns (uint)',
    'function transfer(address to, uint amount)',
    'event Transfer(address indexed from, address indexed to, uint amount)'
  ]

  function Components() {
    const { address, isConnected } = useAppKitAccount()
    const { walletProvider } = useAppKitProvider('eip155')

    async function getBalance() {
      if (!isConnected) throw Error('User disconnected')

      const ethersProvider = new BrowserProvider(walletProvider)
      const signer = await ethersProvider.getSigner()
      // The Contract object
      const USDTContract = new Contract(USDTAddress, USDTAbi, signer)
      const USDTBalance = await USDTContract.balanceOf(address)

      console.log(formatUnits(USDTBalance, 18))
    }
    return <button onClick={getBalance}>Get User Balance</button>
  }
</script>
```

</Tab>

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

</Tabs>

## Alternative Installation

If you are starting from scratch, you can use the following methods to set up your project with Reown AppKit.

<AccordionGroup>
<Accordion title="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.

</Accordion>
<Accordion title="AppKit CLI">
  Reown offers a dedicated CLI to set up a minimal version of AppKit in the easiest and quickest way possible.

To do this, please run the command below.

```bash
npx @reown/appkit-cli
```

After running the command, you will be prompted to confirm the installation of the CLI. Upon your confirmation, the CLI will request the following details:

1. **Project Name**: Enter the name for your project.
2. **Framework**: Select your preferred framework or library. Currently, you have three options: React, Next.js, and Vue.
3. **Network-Specific libraries**: Choose whether you want to install Wagmi, Ethers, Solana, or Multichain (EVM + Solana).

After providing the project name and selecting your preferences, the CLI will install a minimal example of AppKit with your preferred blockchain library. The example will be pre-configured with a `projectId` that will only work on `localhost`.

To fully configure your project, please obtain a `projectId` from the Reown Dashboard and update your project accordingly.

**Refer to [this section](#cloud-configuration) for more information.**

</Accordion>
</AccordionGroup>
