> For the complete documentation index, see [llms.txt](https://developer.trustwallet.com/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.trustwallet.com/developer/trustconnect/quickstart.md).

# Quickstart

Get from zero to a working wallet connection in your React app.

## Step 1 — Install packages

Install the core package, at least one network package, and WalletConnect:

```bash
pnpm add @trustwallet/connect-react \
         @trustwallet/connect-eip155-react \
         @trustwallet/connect-walletconnect
```

EIP-155 requires these peer dependencies:

```bash
pnpm add @tanstack/react-query viem
```

> **Other chains?** Add `@trustwallet/connect-solana-react` for Solana or `@trustwallet/connect-bip122-react` for Bitcoin. See [Solana](/developer/trustconnect/solana.md) and [Bitcoin](/developer/trustconnect/bitcoin.md) for details.

## Step 2 — Configure the provider

Wrap your app with `TrustConnectProvider` and configure the namespaces and services:

```tsx
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { mainnet, polygon } from 'viem/chains'
import { createEIP155 } from '@trustwallet/connect-eip155-react'
import { createWalletConnect } from '@trustwallet/connect-walletconnect'
import { TrustConnectProvider } from '@trustwallet/connect-react'

const queryClient = new QueryClient()
const projectId = import.meta.env.VITE_WALLETCONNECT_ID

const eip155 = createEIP155({
    chains: [mainnet, polygon],
})

const walletConnect = createWalletConnect({
    projectId,
    metadata: {
        name: 'My dApp',
        url: 'https://example.com',
        description: 'My awesome dApp',
        icons: ['https://example.com/icon.png'],
    },
})

function App() {
    return (
        <TrustConnectProvider
            config={{
                namespaces: [eip155],
                services: [walletConnect],
            }}
        >
            <QueryClientProvider client={queryClient}>
                <YourApp />
            </QueryClientProvider>
        </TrustConnectProvider>
    )
}
```

> **WalletConnect project ID** — get yours at [cloud.walletconnect.com](https://cloud.walletconnect.com/).

## Step 3 — Open the connection modal

Use the `useTrustModal` hook to open the wallet selection modal:

```tsx
import { useTrustModal } from '@trustwallet/connect-react'

function ConnectButton() {
    const { open } = useTrustModal()

    return <button onClick={() => open()}>Connect Wallet</button>
}
```

## Step 4 — Read connection state

Use `useConnection` to check if a wallet is connected and read its details:

```tsx
import { useConnection } from '@trustwallet/connect-react'

function WalletInfo() {
    const { isConnected, address, wallet, chain } = useConnection({
        namespaceId: 'eip155',
    })

    if (!isConnected) return <p>Not connected</p>

    return (
        <div>
            <p>Wallet: {wallet?.name}</p>
            <p>Address: {address}</p>
            <p>Chain: {chain?.reference}</p>
        </div>
    )
}
```

## Next steps

* [Modal & Connection Management](/developer/trustconnect/modal-and-connections.md) — fine-grained modal and connection control
* [EVM (EIP-155)](/developer/trustconnect/evm.md) — sign messages, write contracts, and send transactions
* [Solana](/developer/trustconnect/solana.md) — Solana wallet interactions
* [Bitcoin (BIP-122)](/developer/trustconnect/bitcoin.md) — Bitcoin wallet interactions
* [Theming & Customization](/developer/trustconnect/theming.md) — match the modal to your brand


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.trustwallet.com/developer/trustconnect/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
