Skip to main content

Requirements

  • React 18 or higher
  • TypeScript 5 or higher

Installation

Install the Privy React SDK using your package manager of choice:
npm install @privy-io/react-auth@latest
If your app uses Privy’s Solana wallets, install the following peer dependencies:
  • @solana/kit
  • @solana-program/memo
  • @solana-program/system
  • @solana-program/token
Additionally, if you are using webpack, include the following configurations to add them to webpack’s externals config. Note that these configurations are not needed if you are using Turbopack:
// 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;
  }
};
I