> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/clients/typescript/react/installation.md).

# Installation

## Prerequisites

| Requirement            | Version | Notes                   |
| ---------------------- | ------- | ----------------------- |
| Node.js                | 18+     | LTS recommended         |
| React                  | ^18     | Peer dependency         |
| wagmi                  | ^2.0.0  | Peer dependency         |
| viem                   | 2.x     | Peer dependency         |
| seismic-viem           | >=1.1.1 | Seismic transport layer |
| @rainbow-me/rainbowkit | ^2.0.0  | Optional, for wallet UI |

## Install

```bash
npm install seismic-react
```

```bash
yarn add seismic-react
```

```bash
pnpm add seismic-react
```

```bash
bun add seismic-react
```

## Peer Dependencies

`seismic-react` requires several peer dependencies that your project must provide:

| Package                 | Purpose                                                                             |
| ----------------------- | ----------------------------------------------------------------------------------- |
| `react`                 | React runtime                                                                       |
| `wagmi`                 | Ethereum React hooks and wallet connectors                                          |
| `viem`                  | TypeScript Ethereum library (used internally by wagmi)                              |
| `seismic-viem`          | Seismic transport layer providing `ShieldedPublicClient` and `ShieldedWalletClient` |
| `@tanstack/react-query` | Async state management (required by wagmi)                                          |

Install all required peer dependencies:

```bash
npm install react wagmi viem seismic-viem @tanstack/react-query
```

{% hint style="info" %}
If you are using RainbowKit for wallet UI, also install `@rainbow-me/rainbowkit`:

```bash
npm install @rainbow-me/rainbowkit
```

{% endhint %}

## Wagmi Config Setup

Create a wagmi config with Seismic chain definitions:

```typescript
import { getDefaultConfig } from "@rainbow-me/rainbowkit";
import { seismicTestnet } from "seismic-react/rainbowkit";

const config = getDefaultConfig({
  appName: "My Seismic App",
  projectId: "YOUR_WALLETCONNECT_PROJECT_ID",
  chains: [seismicTestnet],
});
```

{% hint style="warning" %}
Replace `YOUR_WALLETCONNECT_PROJECT_ID` with a project ID from [WalletConnect Cloud](https://cloud.walletconnect.com/).
{% endhint %}

## Minimal Working App

```typescript
import { WagmiProvider } from 'wagmi'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { RainbowKitProvider, getDefaultConfig } from '@rainbow-me/rainbowkit'
import { ShieldedWalletProvider } from 'seismic-react'
import { seismicTestnet } from 'seismic-react/rainbowkit'

const config = getDefaultConfig({
  appName: 'My Seismic App',
  projectId: 'YOUR_WALLETCONNECT_PROJECT_ID',
  chains: [seismicTestnet],
})

const queryClient = new QueryClient()

function App() {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <RainbowKitProvider>
          <ShieldedWalletProvider config={config}>
            <YourApp />
          </ShieldedWalletProvider>
        </RainbowKitProvider>
      </QueryClientProvider>
    </WagmiProvider>
  )
}
```

## Package Exports

`seismic-react` provides two entry points:

| Entry Point                | Contents                                                                                                                                |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `seismic-react`            | Main entry -- `ShieldedWalletProvider`, `useShieldedWallet`, `useShieldedContract`, `useShieldedWriteContract`, `useSignedReadContract` |
| `seismic-react/rainbowkit` | Chain configs -- `seismicTestnet`, `sanvil`, `localSeismicDevnet`, `createSeismicDevnet`                                                |

```typescript
// Main entry
import {
  ShieldedWalletProvider,
  useShieldedWallet,
  useShieldedContract,
  useShieldedWriteContract,
  useSignedReadContract,
} from "seismic-react";

// Chain configs for RainbowKit
import { seismicTestnet, sanvil } from "seismic-react/rainbowkit";
```

## TypeScript

TypeScript >= 5.0.4 is an optional peer dependency. `seismic-react` ships with full type definitions and provides type inference from contract ABIs when using hooks like `useShieldedWriteContract` and `useSignedReadContract`.

No additional `@types/*` packages are needed.

## Troubleshooting

### Module Not Found: seismic-viem

Ensure `seismic-viem` is installed as a peer dependency:

```bash
npm install seismic-viem
```

### wagmi Version Mismatch

`seismic-react` requires wagmi v2. If you have wagmi v1 installed, upgrade:

```bash
npm install wagmi@latest viem@latest
```

### RainbowKit Chain Not Appearing

Make sure you import chain configs from the `seismic-react/rainbowkit` entry point, not from the main entry:

```typescript
// Correct
import { seismicTestnet } from "seismic-react/rainbowkit";

// Incorrect -- will not resolve
import { seismicTestnet } from "seismic-react";
```

### React Version Conflicts

If you encounter React version conflicts in a monorepo, ensure all packages resolve to the same React version. Add a `resolutions` field (Yarn) or `overrides` field (npm) to your root `package.json`:

```json
{
  "resolutions": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  }
}
```

## See Also

* [ShieldedWalletProvider](/clients/typescript/react/shielded-wallet-provider.md) -- Provider setup and configuration
* [Hooks Overview](/clients/typescript/react/hooks.md) -- Available React hooks
* [RainbowKit Guide](/clients/typescript/react/wallet-guides/rainbowkit.md) -- Wallet UI integration
* [Privy Guide](/clients/typescript/react/wallet-guides/privy.md) -- Embedded wallet setup


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.seismic.systems/clients/typescript/react/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
