> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sophon.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Thirdweb Wallet

> Integrate the Sophon Account with Thirdweb Wallet

## Thirdweb Wallet

Thirdweb Wallet is a comprehensive wallet solution for React, enabling seamless wallet connection and transaction signing.

<CardGroup cols={1}>
  <Card title="Sophon Account + Thirdweb Wallet example repository" icon="code" href="https://github.com/sophon-org/sophon-account/tree/main/examples/eip-6963-thirdweb">
    Thirdweb Wallet Example
  </Card>
</CardGroup>

### Installation

<CodeGroup>
  ```npm yarn pnpm bun theme={null}
  npm install @sophon-labs/account-eip6963 wagmi viem thirdweb @thirdweb-dev/wagmi-adapter @tanstack/react-query
  ```
</CodeGroup>

### Live demo

<div
  style={{
position: "relative",
width: "100%",
paddingBottom: "75%", // 4:3 aspect ratio, adjust as needed
height: 0,
overflow: "hidden",
borderRadius: "16px",
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
}}
>
  <iframe
    src="https://sophon-account-eip-6963-thirdweb.vercel.app/"
    style={{
  position: "absolute",
  top: 0,
  left: 0,
  width: "100%",
  height: "100%",
  border: "none",
}}
    allowFullScreen
  />
</div>

### Sample configuration

```typescript {15, 24-35} theme={null}
"use client";

import React, { ReactNode } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { State, WagmiProvider } from "wagmi";

import { ThirdwebProvider } from "thirdweb/react";

import { inAppWalletConnector } from "@thirdweb-dev/wagmi-adapter";
import { createThirdwebClient, defineChain } from "thirdweb";
import { http } from "viem";
import { sophonTestnet } from "viem/chains";
import { createConfig, injected } from "wagmi";

import "@sophon-labs/account-eip6963/testnet";

// Get your project ID from https://thirdweb.com
export const projectId = process.env.NEXT_PUBLIC_THIRDWEB_PROJECT_ID;

if (!projectId) throw new Error("Project ID is not defined");

export const client = createThirdwebClient({
  clientId: projectId,
});

export const config = createConfig({
  chains: [sophonTestnet],
  multiInjectedProviderDiscovery: false,
  ssr: true,
  transports: {
    [sophonTestnet.id]: http(),
  },
  connectors: [injected()],
});

declare module "wagmi" {
  interface Register {
    config: typeof config;
  }
}
const queryClient = new QueryClient();

export default function Web3ModalProvider({
  children,
  initialState,
}: {
  children: ReactNode;
  initialState?: State;
}) {
  return (
    <ThirdwebProvider>
      <WagmiProvider config={config} initialState={initialState}>
        <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
      </WagmiProvider>
    </ThirdwebProvider>
  );
}
```
