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 yarn, you must either manually also install @solana/web3.js or add it to webpack’s externals config if your app does not use Solana:

// webpack.config.js
module.exports = {
  //...
  externals: {
    ['@solana/web3.js']: 'commonjs @solana/web3.js'
  }
};

// next.config.js
module.exports = {
  webpack: (config) => {
    // ...
    config.externals['@solana/web3.js'] = 'commonjs @solana/web3.js';
    return config;
  }
};

Was this page helpful?