Skip to main content
Use Privy to add authentication and embedded wallets to a Next.js + React app.
Privy supports multiple authentication methods (email, socials, passkeys, and external wallets). This guide uses email OTP as a simple starting point.

Prerequisites

Create a Privy app in the Privy Dashboard and copy your App ID.

Step-by-step (Next.js + React)

1

Install the React SDK

Install the React SDK.
2

Wrap your app with PrivyProvider

Put your App ID in appId="your-app-id" and wrap your app root. For Solana embedded wallets, set embeddedWallets.solana.createOnLogin to create wallets on login.
Create a client-side provider component, then wrap it in app/layout.tsx.
To use external Solana wallets, pass toSolanaWalletConnectors() to externalWallets. See configuring connector chains.
3

Connect a user

Use Privy’s modal and show a connected state when login completes.
See the Privy Solana wallet docs for transaction examples.