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

# Installation

> Install the Privy React SDK (@privy-io/react-auth) and optional Solana peer dependencies (@solana/kit) for React and Next.js apps

## Requirements

* React 18 or higher
* TypeScript 5 or higher

## Installation

Install the Privy React SDK with a supported package manager:

<CodeGroup>
  ```bash npm theme={"system"}
  npm install @privy-io/react-auth@latest
  ```

  ```bash pnpm theme={"system"}
  pnpm install @privy-io/react-auth@latest
  ```

  ```bash yarn theme={"system"}
  yarn add @privy-io/react-auth@latest
  ```
</CodeGroup>

<Accordion title="Solana dependencies">
  If your app uses Privy's Solana wallets, install the following peer dependencies:

  * `@solana/kit`
  * `@solana-program/memo`
  * `@solana-program/system`
  * `@solana-program/token`

  For webpack, add these packages to the `externals` config. Skip this step for Turbopack:

  ```js theme={"system"}
  // webpack.config.js
  module.exports = {
    //...
    externals: {
      ['@solana/kit']: 'commonjs @solana/kit',
      ['@solana-program/memo']: 'commonjs @solana-program/memo',
      ['@solana-program/system']: 'commonjs @solana-program/system',
      ['@solana-program/token']: 'commonjs @solana-program/token'
    }
  };

  // next.config.js
  module.exports = {
    webpack: (config) => {
      // ...
      config.externals['@solana/kit'] = 'commonjs @solana/kit';
      config.externals['@solana-program/memo'] = 'commonjs @solana-program/memo';
      config.externals['@solana-program/system'] = 'commonjs @solana-program/system';
      config.externals['@solana-program/token'] = 'commonjs @solana-program/token';
      return config;
    }
  };
  ```

  If build errors remain, see the [Vite troubleshooting guide](/basics/troubleshooting/react-frameworks).
  One example is `getTransferSolInstruction` export errors.
</Accordion>

<Info>
  Vite resolves string-literal dynamic imports during dependency optimization, so optional or
  environment-specific packages must be installed for builds to pass. These packages are not
  included in the main runtime bundle; they are loaded only when the dynamic import path is used.
</Info>
